Forked from daegren/xcode-build-number-generator.sh
Last active
May 23, 2022 11:24
-
-
Save TJRoger/9633becb20b087281ed487587dd0ecc6 to your computer and use it in GitHub Desktop.
Script to automatically set the build number to the date
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
#!/bin/sh | |
# xcode-build-number-generator.sh | |
# @desc Automaticvally create build number every time using curent day, month and year | |
# @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 "Link Binaries With Libraries" | |
#Credits | |
# tjroger@github for intial direction about automatic versioning | |
buildNumber=`date +%Y%m%d%H%M` | |
echo "Final Build number is $buildNumber" | |
## Below command write buildNumber in the property list | |
/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