Skip to content

Instantly share code, notes, and snippets.

@m1entus
Forked from alvaroroyo/RunScript.sh
Created September 13, 2022 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m1entus/cd259b32badc29af0196e47d2b74427b to your computer and use it in GitHub Desktop.
Save m1entus/cd259b32badc29af0196e47d2b74427b to your computer and use it in GitHub Desktop.
#Set here your Environment.plist name
ENVIRONMENT="DEV"
#Environment.plist path
ENVIRONMENT_PLIST="$PROJECT_DIR/AppName/Environments.plist"
#Get app name from Environment.plist
APP_NAME=$(/usr/libexec/PlistBuddy -c "Print :$ENVIRONMENT:APP_NAME" "$ENVIRONMENT_PLIST")
#Get bundle identifier from Environment.plist
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :$ENVIRONMENT:BUNDLE_IDENTIFIER" "$ENVIRONMENT_PLIST")
#Set environment app name in Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleName ${APP_NAME}" "${INFOPLIST_FILE}"
#Set environment bundle identifier in Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier ${BUNDLE_ID}" "${INFOPLIST_FILE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment