Skip to content

Instantly share code, notes, and snippets.

@bwoods
Last active August 25, 2018 22:52
Show Gist options
  • Save bwoods/55bed61e2da4b857f04350c9559bbf19 to your computer and use it in GitHub Desktop.
Save bwoods/55bed61e2da4b857f04350c9559bbf19 to your computer and use it in GitHub Desktop.
Xcode build step placing the git hash in the Settings.bundle
# TestFlight has… opinions… about the CFBundleShortVersionString, so this is removed
#defaults write ${CODESIGNING_FOLDER_PATH}/Info CFBundleShortVersionString `git describe --dirty=+ --tags --always`
# add the version info to the Settings.bundle
GitVersion=$(git describe --dirty=+ --tags --always)
CFBundleShortVersionString=$(defaults read ${CODESIGNING_FOLDER_PATH}/Info CFBundleShortVersionString)
plutil -insert PreferenceSpecifiers.0 -xml "<dict><key>DefaultValue</key><string>${CFBundleShortVersionString} (${GitVersion})</string><key>Key</key><string>Version</string><key>Title</key><string>Version</string><key>Type</key><string>PSTitleValueSpecifier</string></dict>" ${CODESIGNING_FOLDER_PATH}/Settings.bundle/Root.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment