Created
June 22, 2015 22:56
-
-
Save leemorgan/794dd8e27e0a9ecc2988 to your computer and use it in GitHub Desktop.
Auto-populate project build number based on current date and time
This file contains 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
# @desc Auto-populate the build number based on the current date and time. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Target Dependencies" | |
now=`date +%y.%m.%d.%H%M` | |
buildNumber=$(printf "%s" $now) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment