Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different iOS application settings in debug/release configuration?

I'm developing an app for the iPad and I have recently added a few settings (like a debug mode switch and an FPS counter switch) to the app's page in Settings.app to make the life of the app testers easier. Of course I don't want to keep these settings there in the final release. Is there a way to hide some of the settings in Settings.bundle in the released version but show them in the debug version? Or, alternatively, is there a way to conditionally use a different Settings.bundle in my app target depending on whether I'm using the release or the debug configuration for compiling the app?

like image 374
Tamás Avatar asked Jan 01 '11 11:01

Tamás


2 Answers

I know this to late, but this may help other people

This is how i solved same problem

  • Create 2 Root.plist file one for Debug and one for Release.
  • Add this Run script in your build process.

 if [ "$CONFIGURATION" == "Debug" ];then
    rm -f "$SRCROOT/Settings.bundle/Root.plist"
    cp "$SRCROOT/Debug/Root.plist" "$SRCROOT/Settings.bundle" 
else
    rm -f "$SRCROOT/Settings.bundle/Root.plist"
    cp "$SRCROOT/Release/Root.plist" "$SRCROOT/Settings.bundle" 

like image 166
Naveen Murthy Avatar answered Sep 30 '22 17:09

Naveen Murthy


You can, in the project build settings, define a C preprocessor macro specific to each configuration. For example, I have -DDEBUG in debug configuration, which defines the DEBUG macro. Then, code can be conditionaly compiled with #ifdef DEBUG ... #endif.

Also, the Info.plist file can be preprocessed.

like image 40
F'x Avatar answered Sep 30 '22 16:09

F'x