Taken from this link https://developer.apple.com/forums/thread/128166
ZIP
- Create a directory that holds everything you want to distribute.
- Run the ditto as shown below, where DDD is the path to the directory from step 1 and ZZZ is the path where ditto creates the zip archive.
- % ditto -c -k --keepParent DDD ZZZ
PKG
Use the productbuild
tool to create a simple installer package for a single app:
% productbuild --sign III --component AAA /Applications PPP
In this example:
III
is either your Mac Installer Distribution or Developer ID Installer signing identity, depending on your distribution channel. This will typically be named3rd Party Mac Developer Installer: TTT
orDeveloper ID Installer: TTT
, whereTTT
identifies your team.AAA
is the path to your app.PPP
is the path whereproductbuild
creates the installer package.
DMG
- Use the hdiutil tool to create a disk image for distribution:
- Create a directory to act as the source for the root directory of your disk image’s volume.
- Populate that directory with the items you want to distribute.
- Use hdiutil command shown below to create the disk image, where SSS is the directory from step 1 and DDD is the path where hdiutil creates the disk image.
- Use codesign command shown below to sign the disk image, where III is your Developer ID Application signing identity (typically named Developer ID Application: TTT, where TTT identifies your team), BBB is a pseudo bundle ID as discussed in Basic Signing, and DDD is the path to the disk image from step 3.
- % hdiutil create -srcFolder SSS -o DDD