Search code examples
objective-capp-storetestflightcompiler-flags

How to automatic distinguish two iOS app build packages


I am developing an iOS app and are using Testflight to send the app to my testers. In this app version I have a feedback form which the users is using to send me feedback. I want a good way to automatic distinguish some code in this build from the build I will send to AppStore.

Example:

#ifdef TestFlightPackage
//code for the feedback form
#endif

I can add a preprocessor macro for instance

TestFlightPackage=1

But I don´t want to change this everytime I create a package. I want a way to solve this automatic. Compare to publish profile in Visual Studio. If I choose Publish profile "Release" the flag is TestFlightPackage=0 (or the flag removed) and if I choose Publish profile "Testing" I will get TestFlightPackage=1

Which is the best solution for this?


Solution

  • For this purpose you need to create different schemes.You can find here a detailed answer on the similar question.