Preprocessor macros and configuration

In your xcode settings, you might have seen the configurations as shown below:
Screen Shot 2015-12-18 at 4.36.52 PM
You can find the current configuration :
xcodebuild -workspace test.xcworkspace -scheme “UXtests” -showBuildSettings
You would use it in the code as follows :
#ifdef TESTING
// do something
#endif
But how would you apply the debug and testing configurations. These preprocessor statements can’t be applied when you run your project by running command + r. These can be used through the command line as follows:

xcodebuild -workspace Test.xcworkspace -scheme “ux tests” -derivedDataPath build/DerivedData -configuration Testing

Thats how you use it. Next time someone asks you, remember this.

In

Leave a Reply

Your email address will not be published. Required fields are marked *