Skip to content

Instantly share code, notes, and snippets.

@SergLam
Created October 7, 2019 11:19
Show Gist options
  • Save SergLam/40299ffa456f0b8cab22470df1099735 to your computer and use it in GitHub Desktop.
Save SergLam/40299ffa456f0b8cab22470df1099735 to your computer and use it in GitHub Desktop.
AppVersion Launch screen
# Output version & build number to the APP_VERSION label on LaunchScreen.storyboard
versionNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${INFOPLIST_FILE}")
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${INFOPLIST_FILE}")
sed -i "" -e "/userLabel=\"APP_VERSION\"/s/text=\"[^\"]*\"/text=\"Version: $versionNumber ($buildNumber)\"/" "$PROJECT_DIR/LaunchScreen.storyboard"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment