Quick Start Guide
This Quick Start Guide is designed to introduce the key AppCode concepts and help you quickly get started with the IDE.
Step 0. Before you start
Do I need Xcode at all?
Yes, you do. AppCode will not run without Xcode available.
Which version of Xcode should be installed?
Please, check the Installation Requirements section above.
Can I use both AppCode and Xcode at the same time?
AppCode uses the same project model and project file, and synchronizes all changes with Xcode. You can work simultaneously in both IDEs, make changes and jump back and forth – AppCode will make sure that everything is synchronized and up to date.
Is AppCode macOS only?
Yes, because AppCode needs Xcode and Xcode runs on macOS.
Will I be able to work with my project in Xcode after I edit it in AppCode?
Yes, AppCode uses the same project model as Xcode.
Step 1. Open/Create a project in AppCode
Open an existing project
Begin by opening one of your existing projects stored on your computer. You can do this right from the Welcome screen: just click , and locate the
AppCode is fully compatible with Xcode: it uses the same project model and project file, and synchronizes all changes with Xcode. You can work simultaneously in both IDEs, make changes and jump back and forth – AppCode will make sure that everything is synchronized and up to date.
Check out an existing project from Version Control
You can also download sources from a VCS storage or repository. Choose Git, GitHub, CVS, Mercurial, Subversion, Perforce or TFS, and then enter your credentials to access the storage. Then, enter a path to the sources and clone the repository to the local host:
Create new project
AppCode supports all Xcode templates, so you can create new projects the same way you do in Xcode.
Step 2. Look around
When a project is opened, you see the main window divided into several logical areas. Let’s take a moment to see the key UI elements here:
- Project view on the left side presents your project in a familiar way, like Xcode does.
- Smart code editor on the right side has tabs for easy navigation between open files.
- Navigation bar above the editor additionally allows to quickly run, debug, test or profile your application.
- Left gutter: this vertical stripe next to the editor shows the breakpoints you have, and provides a convenient way to navigate through the code hierarchy like going to definition, subclass, superclass, etc. It also shows line numbers and per-line VCS history.
- Right gutter: AppCode constantly tracks the quality of your code, and you can see the results of code analysis instantly in the right gutter: errors, warnings, etc. The square in the right corner shows the overall status of code analysis for the file.
- Tool windows are specialized windows attached to the bottom and sides of your workspace. These provide access to typical tasks such as project management, source code search and navigation, running and debugging, integration with version control systems, etc.
- The status bar indicates the status of your project and the entire IDE. It also shows various warnings and information messages like file encoding, line separator, inspection profile, and so on. In addition, here you can find the Resolve Context chooser for switching between the Debug and Release contexts (with or without debug info) to resolve your code in the IDE with the desired definitions.
Step 3. Customize your environment
AppearanceThe first thing to fine-tune is the general "look and feel." Go to AppCode | Preferences | Appearance and Behavior | Appearance to select the IDE theme: the default light theme, Darcula if you prefer a darker setting, or Xcode theme.
The many screens available under AppCode | Preferences | Editor help you adjust every aspect of the editor’s behavior. A lot of options are available here, from general settings (like Drag'n'Drop enabling or scrolling configuration), to color configuration for each available language and use case, to tabs and code folding settings, to code completion behavior and even postfix templates.
Code style settings can be defined for each language under AppCode | Preferences | Editor | Code Style. These allow you to have your code automatically formatted as you write it, without any additional actions. You can also create and save your own coding style schemes.
AppCode uses the keyboard-centric approach, meaning that nearly all actions possible in the IDE are mapped to keyboard shortcuts. The set of keyboard shortcuts you work with is one of your most intimate habits – your fingers "remember" certain combinations of keys, and changing this habit is easier said than done.
AppCode supplies you with a great default keymap (choose AppCode | Preferences | Appearance and Behavior | Keymap. There are also some predefined keymaps (like Xcode, Emacs, Visual Studio, Eclipse or NetBeans), and you can also create your own keymap based on an existing one.in the main menu) making your coding really productive and convenient. However, you can always change it by going to
Step 4. Code with smart assistance
AppCode takes care of the routine so that you can focus on the important. Use the following coding capabilities to create error-free applications without wasting precious time.
Code completion is a great time-saver, regardless of the type of file you’re working with. There are two types of code completion in AppCode: basic (⌃Space) and smart (⌃⇧Space). Basic completion works as you type and completes any name instantly. Smart completion analyzes the context you’re currently working in and offers more accurate suggestions based on that analysis. It filters the list of functions and variables to match the expression type:
AppCode keeps an eye on what you are currently doing and makes smart suggestions, called intention actions, to save more of your time. Indicated with a lightbulb, intention actions let you apply automatic changes to code that is correct (in contrast to code inspections which provide quick-fixes for code that may be incorrect). Do you want to localize the string quickly or use it as a format string? Not a problem with AppCode. Click the lightbulb (or press ⌥⏎) and select one of the suggested options: The full list of available intention actions can be found in .
Step 5. Keep your code neat
AppCode constantly tracks the quality of your code, detects potential errors and problems and suggests quick fixes for them. Every time it finds a potential problem, like unused code, unresolved method, non-localized string or even invalid parameter in a function, you’ll see a light bulb in the left gutter. Click on it, or hit ⌥⏎ to apply a fix
You can also run code analysis in a bulk mode to see all potential problems in your project and fix them at once. To do so, choosefrom the main menu.
For the complete list of available inspections select. You can disable some of them, or enable others, plus you can adjust the severity of each inspection. You decide whether it should be considered an error or just a warning.
Step 6. Generate some code
With AppCode you can always practice creating new classes, methods and categories from usage. Just write a definition in your code or type the method name with parameters, press ⌥⏎ and create method or class definitions automatically:
Adding new classes, protocols, categories, files from Xcode templates, etc. in AppCode is a snap: select from the main menu, or press ⌘N. Select an element from the list and enter its name.
There are also so-called Surround With templates available with ⌥⌘T shortcut: select a block of code and hit ⌥⌘T to surround it with a
@autoreleasepool, or your own construct that can be defined under .
There are various code generation options to be found underin the main menu:
- Override/Implement methods (⌃O/⌃I) - Override or implement multiple methods with a single shortcut.
- Declare members - Declare members in an interface or private category, or keep them in the implementation in a second, without the need to navigate anywhere.
- Generate (⌘N) - A powerful code generation tool to automatically create a variety of constructs, for example
Step 7. Find your way through
With a project’s growth and when you work with someone else’s code, it’s vital to be able to quickly find the elements of interest and dig into the code. AppCode comes with a set of navigation features that will help you find your way through any code, no matter how tangled.
When you explore a project’s source code, it’s often important to know where this or that symbol is actually used. To find that out, place the caret at the symbol’s name and hit ⌥F7. AppCode will find the actual usages, not just text matches. Moreover, it understands and can be used with localization, Core Data and
If you need the regular full-text search, just press ⌘F to search in the current file or ⇧⌘F to search within arbitrary scope, directory or the entire project.
You can tell a lot just by looking at your File Structure, with its imports or call hierarchies, and possibly use it to navigate to:
- Class by its name (⌘O)
- File by its name (⇧⌘O)
- Symbol by its name (⌥⌘O)
- Declaration (⌘B)
- Base class/base function (⌘U)
Quick definition and documentation
Quick Definition (⌥Space) will help you to see the contents of a method without jumping to it. Press ⌘P (Parameter Info) to see the list of parameters this method can take.
For documentation, just press F1. AppCode also supports two external documentation browsers, Dash and Ingredients, which you can enable by selecting .
Navigate through the timeline
Remembering all your activity in the project, AppCode can easily navigate you to the Recent Files (⌘E) or Recently Changed Files (⌥⇧C). To go through the history of changes, try using Back/Forward navigation (⌘[⌘]) and/or go to last edit location (⇧⌘⌫).
Take advantage of many smart actions possible with AppCode. For example, use the Find Action search (⇧⌘A): just type a part of the action name, and the IDE will show you the list of all available options. Then, select the action you need:
If you have a general idea of what you're looking for, you can always locate the corresponding element using one of the existing navigation features. But what if you really want to look for something in every nook and cranny? The answer is to use Search Everywhere! To try it, click the magnifying glass in the upper right-hand corner of the window, or press Shift twice.
Step 8. Refactor
It is important to be able to easily improve code design as it evolves with time. One of the AppCode's most distinguishing features is its refactoring abilities: always at hand, safe and accurate. These are refactorings you can truly rely on, including vital ones as Rename, Move, Extract, Inline, Change Signature, Pull Members Up, Push Members Down, and many others.
When using Rename, you want to be sure all the changes are applied safely. Not to worry - that’s exactly how it is in AppCode. Just place a caret at any element - variable, class, method, property, you name it - and press ⇧F6. Rename even works across non-code usages like xib, storyboard files and localization files.
To quickly move code around in a full swing of refactoring, consider inlining some variable, or extracting an expression to a variable. You can even extract a full code block into a new method, and add a parameter to it using Introduce Parameter refactoring.
Refactoring your source code should be easy. That’s why in AppCode you can just press ⌃T to see what refactorings are suitable for the current context.
Step 9. Run and debug
Now, when you’ve played with the code and discovered what you can do with it, it’s time to run your app. In AppCode this is done by means of so called Run/Debug Configurations. Opento see all available options.
Run configurations in AppCode reflect Xcode schemes, and synchronize with them. Notice, that Run (⌃R and Debug (⌃D in AppCode are two different actions. Sometimes launching your app in debug mode could be a heavy operation which can make it more difficult to identify your issue. In this case you may want to run your app without stopping at breakpoints, and try using it the same way your users would.
AppCode’s debugger offers the perfect runtime view of the application. Once you stop on a breakpoint, it shows descriptions of all the variables available, content of collections and dictionaries, and even actual values of Core Data objects’ properties. Don’t waste your time - investigate the problem instead:
When you need to evaluate the value of an arbitrary expression, we strongly recommend the Evaluate expression feature. Select the expression you need to evaluate, press ⌥F8 and see the results in the same way as you see them in the debugger window:
Step 10. Create and run tests
If you enjoy test-driven development, AppCode is just the right tool to use as it completely supports OCUnit and Kiwi testing frameworks out of the box.
To create a test go toIn AppCode you can run all tests at once, or a single test. Create different and AppCode will generate a standard OCUnit test for you from template. You can also create your own template for a test, or for any other file under .test configurations to suit better your needs: simply specify a test target in a Run Configuration. To run any test configuration, just invoke the Run popup (⌃⌥R) and select the one you need.
The test runner will display the test results in the dedicated Test view where you can explore them, navigate to the problems, see the test running statistics, and re-run a failing test - no need to re-run them all.
Step 11. Keep your source code under Version Control
If you are keeping your source code under version control, you will be glad to know that AppCode integrates with many popular version control systems: Git (or GitHub), Mercurial, Perforce, TFS, Subversion and CVS.
To specify credentials and any settings specific to a particular VCS, go toThe VCS menu will give you a clue about what commands are available. For example, you can see the changes you’ve made, commit them, create changelists and much more from the Changes view: VCS | Show Changes View (or just press ⌘9). Some basic commands can also be easily found in the Navigation bar above the editor:
In addition to traditional version control, you can use Local History. With Local History, AppCode automatically tracks changes you make to the source code, the results of refactoring, etc. Local History is always enabled. To view it for a file or a folder, select . Here you can review the changes, revert them or create a patch.
That’s it! Develop with pleasure!
We hope this brief overview of essential AppCode features will give you a quick start. There are many important features that make a developer’s life easier and more fun, and their source code neater and cleaner. Take these first few steps now, and then dig deeper when you feel the time is right. Enjoy AppCode!
With any questions please visit our AppCode Discussion Forum, twitter and blog, where you can find news, updates, and useful tips and tricks. Also, don't hesitate to report any problems to our support team) or the AppCode issue tracker.