Skip to content

Instantly share code, notes, and snippets.

@leemorgan
Created June 22, 2015 22:56
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 leemorgan/794dd8e27e0a9ecc2988 to your computer and use it in GitHub Desktop.
Save leemorgan/794dd8e27e0a9ecc2988 to your computer and use it in GitHub Desktop.
Auto-populate project build number based on current date and time
# @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