I’ve followed the instructions from TestFlight to duplicate the “release” configuration. Also I’m using TestFlight SDK to get live reports from my app. By doing this I had to include some TestFlight code in my application. Of course I don’t want to have this code in my release version of my app.
Is there some way to only include this code in the testflight configuration (the duplicated release configuration)? The same way you can do with #ifdef DEBUG for the debug configuration (or do I have to create a separate target for this and only include the TestFlight SDK in that target?)
You can exclude code from running using
#ifdefstatements pretty easily, as we suggest it for our HockeyApp service here: http://support.hockeyapp.net/kb/client-integration/crash-reporting-on-ios-quincykitBasically it is:
Add a preprocessor macro to your Xcode project for all configurations:
CONFIGURATION_$(CONFIGURATION)Then you will be able to use these lines of code to include code only for a specific configuration:
This replace
Betawith the name of your configuration that should include the code onlyThe link above provides images and more detailed text on how to do it. Since you will use that library only in your beta distribution configuration, you don’t need to create another configuration besides the already created one for beta distribution.
You need to have one configuration for debug, which is for development, one for beta distribution to set the adhoc entitlements and one for app store distribution. The last two are usually variations of the release configuration.