1.8 KiB
Introduction
It can be useful to use a different setup depending on your Xcode build configuration, e.g. disable Beta Update checks in Debug builds.
To do that, we recommend to define a preprocessor macro for all configurations and use compiler directives to setup the SDK depending on the currently used build configuration.
Note: Beta Update checks is automatically disable when the SDK detects it is running in an App Store build. So you don't have to do anything in that scenario!
HowTo
-
Select your project in the Project Navigator.
-
Select your target.
-
Select the tab "Build Settings".
-
Enter "preprocessor macros" into the search field.
-
Select the top-most line and double-click the value field.
-
Click the + button.
-
Enter the following string into the input field and finish with "Done".
CONFIGURATION_$(CONFIGURATION)
Now you can use #if defined (CONFIGURATION_ABCDEF)
directives in your code, where ABCDEF
is the actual name of your build configuration.
Note: Make sure to use build configuration names without spaces!
Example
#if defined (CONFIGURATION_Debug)
[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"<>"
delegate:nil];
[[BITHockeyManager sharedHockeyManager] setDisableUpdateManager:YES];
#else
[[BITHockeyManager sharedHockeyManager] configureWithBetaIdentifier:@"<>"
liveIdentifier:@"<>"
delegate:nil];
#endif
[[BITHockeyManager sharedHockeyManager] startManager];