문제

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
도움이 되었습니까?

해결책

다른 팁

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top