I would like to include the application version and internal revision, something like 1.0.1 (r1243), in my application\'s settings bundle.
The Root.plist file contai
My working Example based on @Ben Clayton answer and the comments of @Luis Ascorbe and @Vahid Amiri:
Note: This approach modifies the Settings.bundle/Root.plist file in working copy of repository
Add a settings bundle to your project root. Don't rename it
Open Settings.bundle/Root.plist as SourceCode
Replace the contents with:
PreferenceSpecifiers
DefaultValue
Key
version_preference
Title
Version
Type
PSTitleValueSpecifier
StringsTable
Root
Add the following script to the Build, Pre-actions section of the project (target) scheme
version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$PROJECT_DIR/$INFOPLIST_FILE")
build=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$PROJECT_DIR/$INFOPLIST_FILE")
/usr/libexec/PlistBuddy -c "Set PreferenceSpecifiers:0:DefaultValue $version ($build)" "${SRCROOT}/Settings.bundle/Root.plist"
Build and Run the current scheme