Skip to content

Instantly share code, notes, and snippets.

@Valthoron
Forked from sekati/xcode-build-bump.sh
Last active October 13, 2025 10:29
Show Gist options
  • Select an option

  • Save Valthoron/5317029 to your computer and use it in GitHub Desktop.

Select an option

Save Valthoron/5317029 to your computer and use it in GitHub Desktop.
Set a timestamp as the build number when an Xcode project is compiled.
# xcode-build-timestamp.sh
# @desc Set a timestamp as the build number when the project is compiled.
# @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"
buildNumber=$(date +%Y%m%d%H%M)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
@zaferbozkurt
Copy link

more readable with below code

buildNumber=$(date +%Y.%m.%d.%H.%M)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment