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 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. Initial setup
Import settingsWhen you first launch AppCode after the installation, it will suggest importing the settings from the previous installation:
On the next screen you can select the desired behavior (keymap + UI theme) to use in AppCode:
- Select Default or Darcula option if you want to use IntelliJ keymap with the corresponding UI theme (light or dark).
- Select Xcode behavior in case you want to set the interface theme similar to Xcode and use a special keymap which is close to the Xcode default keymap.
Choose plugins and start using AppCode
On the next two screens of the initial setup wizard, you will be able to configure the set of default plugins bundled into the IDE and install helpful third-party plugins if needed.
Step 2. 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 3. 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 4. 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 (choosein the main menu) making your coding really productive and convenient. However, you can always change it by going to . 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.
Step 5. 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 (N/A) and smart (N/A). 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 N/A) and select one of the suggested options: The full list of available intention actions can be found in .
Step 6. 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 N/A 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 7. 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 N/A 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/A. Select an element from the list and enter its name.
There are also so-called Surround With templates available with N/A shortcut: select a block of code and hit N/A 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 (N/A/N/A) - 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) - A powerful code generation tool to automatically create a variety of constructs, for example
Step 8. 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 N/A. 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 N/A to search in the current file or N/A 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 (N/A)
- File by its name (N/A)
- Symbol by its name (N/A)
- Declaration (N/A)
- Base class/base function (N/A)
Quick definition and documentation
Quick Definition (N/A) will help you to see the contents of a method without jumping to it. Press N/A (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 (N/A) or Recently Changed Files (N/A). To go through the history of changes, try using Back/Forward navigation (N/AN/A) and/or go to last edit location (N/A).
Take advantage of many smart actions possible with AppCode. For example, use the Find Action search (N/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 9. 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 N/A. 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 N/A to see what refactorings are suitable for the current context.
Step 10. 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 (N/A and Debug (N/A 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 N/A and see the results in the same way as you see them in the debugger window:
Step 11. 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 (N/A) 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 12. 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 N/A). 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.