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
The other answers do not work correctly for one reason: The run script build phase isn't executed until AFTER the Settings Bundle has been packaged. So, if your Info.plist version is 2.0.11 and you update it to 2.0.12, then build/archive your project, the Settings bundle will still say 2.0.11. If you open the Settings bundle Root.plist, you can see that the version number does not get updated until the END of the build process. You can build the project AGAIN to get the Settings bundle updated correctly, or you can add the script to a pre-build phase instead...
Add your script to the text area. The following script worked for me. You may need to modify the paths to match your project setup:
versionString=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
/usr/libexec/PlistBuddy "$SRCROOT/Settings.bundle/Root.plist" -c "set PreferenceSpecifiers:0:DefaultValue $versionString"
This will correctly run the script BEFORE the Settings bundle is packaged during the build/archive process. If you open the Settings bundle Root.plist and build/archive your project, you will now see the version number is updated at the beginning of the build process and your Settings bundle will display the correct version.