Testing is crucial to find bugs but also to get a feel of the user interface for an app, specially iPhone apps which can make it or fail depending how good the user interface is designed.
If you want to distribute a pre-release version of an app for the iPhone one should create an Ad Hoc version. Installing Ad Hoc versions into iTunes is very easy, just drag’n’drop the app bundle onto iTunes. But installing updates without updating the bundle version number in the Info.plist
opens for some uncertainty of what version actually is installed and run on the iPhone. You might get a question about installing the updated version into iTunes but as there might be a version with the same version number installed on the iPhone the new will not get installed on it.
One can manually update the bundle version number before sending the updated version to the Ad Hoc crew. But this can easily be forgotten and sending updates to itunesconnect
may have to managed too, well if one want an increasing release number series without holes.
As I am pretty lazy and computers should be good at handling tedious task I wrote a small build script that adds a 12 digit date number to the version numbers. This includes up to the second when the app was compiled.
The build script was placed first in the series of build steps and changed to use /bin/bash as the shell.
Below is the actual script.
# get the previous bundle version number without the date number
export VERSION=`/usr/libexec/PlistBuddy "$TARGET_BUILD_DIR/$INFOPLIST_PATH" \
-c "Print CFBundleVersion" | sed -E 's/.[0-9]{12}//g'`
# get current date and time number
export DATE=`date +%y%m%d%H%M%S`
# update the bundle version number
/usr/libexec/PlistBuddy "$TARGET_BUILD_DIR/$INFOPLIST_PATH" \
-c "Set CFBundleVersion $VERSION.$DATE"
# convert back to binary format
plutil -convert binary1 "$TARGET_BUILD_DIR/$INFOPLIST_PATH"
I started to use this method on our Chess app which later was accepted on itunesconnect
having this version number format. The version number presented in iTunes and the App Store seem to be the number entered when submitting the app to the App Store. As you can see in the image to the left I compiled it pretty late on September 25th.
Hope this can help making Ad Hoc life a little easier for others as it helps me being even lazier.
By Edward Patel, 17 Oct 2009
Tweet
Show comments