Another Programming Blog

(mostly iOS and Ruby on Rails)

iOS: Configure a Different App-icon for Debug-builds

When developing an app, it’s sometimes nice to have a different logo for debug builds (play-icon in XCode) and archive builds. Especially when the versions behave differently.

Now, you can configure the different behavior by passing different values in “Preprocessor Macros” (Build Settings of your target in XCode), but here is just a quick tip on how to set different app-icons:

There’s many ways to go about it, including a prefix file, but I’m just setting the name of the icon file in “Preprocessor Definitions” like this:

plist Variables

And then in the plist itself I susbstitute the icon-filename with the variable name set above:

<... omitted ...>
<dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
                <key>CFBundleIconFiles</key>
                <array>
                        <string>APP_ICON_FILE</string>
                        <string>APP_ICON_FILE</string>
                        <string>Default</string>
                </array>
        </dict>
</dict>
<... omitted ...>

And that’s about it.

P.S.: You can follow me on Twitter.

Comments

Webmentions