Created
November 26, 2014 20:21
-
-
Save akramhussein/7ac998a4ed614043ef4d to your computer and use it in GitHub Desktop.
XCode Project - Set Version String And Build Number In Settings Bundle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# TASK: Create Item in Settings.bundle Root.plist | |
# Get version string | |
versionString=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE") | |
# Get build number | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") | |
# Set settings bundle value | |
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:0:DefaultValue $versionString (Build: $buildNumber)" "${SRCROOT}/${PROJECT}/Settings.bundle/Root.plist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment