Tamás
Tamás

Reputation: 48071

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?

Upvotes: 5

Views: 5796

Answers (2)

Naveen Murthy
Naveen Murthy

Reputation: 3681

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" 

Upvotes: 6

F'x
F'x

Reputation: 12308

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.

Upvotes: 3

Related Questions