Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automating DMG build in Xcode 4.0

Tags:

xcode

macos

dmg

I've just updated to Xcode 4.0.2 and I have a project which builds a DMG file as part of the final build phase. This worked great in Xcode 3.2.x but is broken in Xcode 4 because of the way it builds a release version when building to archive. Is there a way to make Xcode 4 build a release version into a Release folder just like Xcode 3.2 did so I can automate the DMG build?

Thanks, J

like image 729
JWood Avatar asked May 21 '11 11:05

JWood


1 Answers

Go to the menu Product>Edit scheme. Then ensure to select the Deployment target. Open the Archive section, select the Post-action item, and add a new shell script action.

Then type your commands for creating the DMG. You could for example use the hdiutil command:

hdiutil create $BUILT_PRODUCTS_DIR/Archive.dmg -srcfolder $BUILT_PRODUCTS_DIR -ov
like image 63
p4010 Avatar answered Nov 16 '22 02:11

p4010