DMG build phase for Xcode projects

I’d been meaning to put together a script to automate the creation of disk images for a while now. I thought I’d link it in with the build phase, so I could have a brand spanking new disk image for each build. I’m placing the script below for anyone to use.

imagename=”$PROJECT_NAME.dmg”
if [ -e "$imagename" ]
then
rm “$imagename”
fi
hdiutil create -srcfolder $CONFIGURATION_BUILD_DIR -volname “$PROJECT_NAME” “$imagename”

It’s all fairly simple bash script, and logically executes the statements. The most difficult part of the project was remembering to escape the variables in the hdiutil command. The next step will be subversion integration for version numbers. Stay tuned!

Technorati Tags:
,

Comments are closed.