Question

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

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top