Our DNA is written in Objective-C

Quick Batch Version Bump

On my iCatalog project I have more than 40 targets (FOURTY!), all with individual info.plist. Let me share a quick command line script that lets me simultaneously bump the software version to a different value for all targets at the same time. This has proven extremely helpful.

The script I use uses the defaults tool to write the new value into the plists and then converts it back to text xml plist format.

if [ "$#" -ne 1 ]
        echo "Usage: bump_version_to <version>"
        exit 1
for FILE in `ls */*Info.plist`
        defaults write "$INFO_PLIST" CFBundleVersion "$1"
        plutil -convert xml1 "$INFO_PLIST.plist"

Put this script into your project root. It expects the info.plist files to be one level below it. Make it executable with chmod +x. Run it passing the new version string. Boom!

Categories: Recipes

%d bloggers like this: