Question

I had an idea to have both the App Store version of my application and Development version of my application on my phone. I have accomplished this by changing the bundle ID. However I was curious if there would be a way to write a script to determine what the Bundle ID is, and to change the app icon based on what the ID is. Any ideas on how to go about this? So far I have this script:

BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "${BUILD_ROOT}/${INFOPLIST_PATH}")
NORMAL_ID="com.appName"
if [BUNDLE_ID != NORMAL_ID]; then
    // Set testing app icon
else
    // Use normal app icon
fi
Was it helpful?

Solution

OTHER TIPS

Take a look at this article: Overlaying Application Version on Top of Your Icon.

What he's doing is renaming icon files to IconXXX_base, and then running a script on each build to generate final icons.

For the SHELL part of it, I think you need a dollar $ sign and double-quotes " for the variables.

if [ "$BUNDLE_ID" != "$NORMAL_ID" ]; then
    // Set testing app icon
else
    // Use normal app icon
fi
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top