Twitter Updates

Saturday, 24 January 2009

Create .dmg files from the command line

While working on my sourceforge project FileExplorer I wanted to have an alpha release at which point I discovered that I can not upload .app's directly they have to be bundled inside a .dmg file.

The command line utility for this is called hdiutil. Then man page can be found here :

http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man1/hdiutil.1.html

The Line I use for my app is
$hdiutil create ./dist/FileExplorer.dmg -srcfolder ./dist/ -ov

This creates a .dmg in the dist folder with the existing contents of dist (where the .app is located). The file is part of a script which makes sure there are no .dmgs inside the dist folder first though. -ov Allows the file to be overidden if it is already there, useful if not part of the prementioned script.

No comments: