How to run a Unit Test

I have an Xcode 4.2 project with unit tests, how do I run them in AppCode. I can't find any menu command to run the tests. One would think that would be an easy thing to rund, a test instead of run menu command.

Gee, one main reason I do not use AppCode is the lack of documentation is a killer.

Comment actions Permalink


You first add a new OCUnit target to your AppCode project from the Run menu (Edit Configurations). Then you can select the UnitTest target in the upper right corner of the IDE and run your tests with the green arrow.

With regards,


Comment actions Permalink

You can also run a test from the current context with a shortcut or a menu:

Screen Shot 2011-12-15 at 15.21.53 .png

Comment actions Permalink

Is there a "trick" in App code for running the OCUnit tests after the app is launched.

Is there a document that describes running the tests without the app and with the app?


Comment actions Permalink


AppCode doesn't have any special configuration - it simply runs tests from the corresponding targets for you.
There are 2 types of unit tests in OC - Logic and Application (I guess you refer to the latter when saying "running tests when after the app is launched").

You can check apple's documentation regarding the configuration of various types of tests:

Anton Makeev

Comment actions Permalink

Thanks for the link.

Does App Code support creating test classes like intellij does? If not I think that's a feature that should be added.


Dave Crane


Please sign in to leave a comment.