Additionally, if you add CFBuildDate as a string and CFBuildNumber as a string into your info.plist, the following shell script (when added to your run script build phase /bin/bash will automatically update your build number and date:
# Auto Increment Version Script
buildPlist=${INFOPLIST_FILE}
CFBuildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBuildNumber" $buildPlist)
CFBuildNumber=$(($CFBuildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBuildNumber $CFBuildNumber" $buildPlist
CFBuildDate=$(date +%Y%m%d%H%M%S)
/usr/libexec/PlistBuddy -c "Set :CFBuildDate $CFBuildDate" $buildPlist
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…