Package and publish

Create and test a disk image

Build a simple read-only DMG, place the signed app inside it, and verify both the disk image and copied application.

12 minute lesson

~~~

A disk image is the classic Mac install experience: the download mounts as a volume, the window shows your app next to an Applications alias, and the user drags the app across. One gesture, no installer.

Build the image from a staging folder containing exactly what users should see — the app and an Applications symlink:

mkdir release-dmg
cp -R Notes.app release-dmg/
ln -s /Applications release-dmg/Applications

Then create a compressed, read-only image:

hdiutil create -volname "Notes" \
  -srcfolder release-dmg \
  -ov -format UDZO Notes-1.2.0.dmg

UDZO is the compressed read-only format meant for distribution. Read-only is a feature here: nothing inside the image can change after you verify it.

If the DMG is what you notarize and publish, staple the ticket to the DMG itself:

xcrun stapler staple Notes-1.2.0.dmg
xcrun stapler validate Notes-1.2.0.dmg

Now test it the way a user experiences it. Mount the image, drag the app to Applications, eject the image, and launch the copy from /Applications. Do this on a standard (non-admin) account.

Why insist on the copy step? Apps launched straight from a mounted image run from a read-only, temporary location — macOS may even run them translocated from a randomized path. Users who skip the drag end up with an app that vanishes when the image ejects, or one that can’t write its own support files. Make the drag target obvious in the window, and never require writes inside the read-only image.

My advice on appearance: skip the custom background art and pixel-perfect icon layouts, at least at first. Fancy DMG layouts are a pile of fragile build steps for a window users see once.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →