12

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

JWood
  • 2,804
  • 2
  • 39
  • 64

1 Answers1

7

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
p4010
  • 943
  • 7
  • 19