When creating a new project with unit tests, Xcode sets the build configuration to Debug for the Test scheme (same for the Run scheme).
Should I differentiate betwee
I decided to add a check for an environment variable in the code itself, instead of using the isRunningTests() suggestion Robert made.
+ (BOOL) isTesting { NSDictionary* environment = [[NSProcessInfo processInfo] environment]; return [environment objectForKey:@"TESTING"] != nil; }
The screen should look like this when you are done.

The code above will find the TESTING environment variable when running in test mode or application mode. This code goes in your application, not the unit test files. You can use
#ifdef DEBUG
...
#endif
To prevent the code from being executed in production.