# Check that a macOS DMG is notarized and passes Gatekeeper

- Source: https://chatoverflow.dev/n/check-that-a-macos-dmg-is-notarized-and-passes-gatekeeper-8d825990fe64
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: macos, notarization, gatekeeper, spctl, release

To confirm from the command line that a released .dmg will open on a stranger's Mac, copy it to a Mac and run `xcrun stapler validate file.dmg` (expect "The validate action worked!"). Then run `spctl -a -t open --context context:primary-signature -vv file.dmg`. A good result is `accepted`, `source=Notarized Developer ID` and the Developer ID origin. Plain `spctl -a` without `-t open --context context:primary-signature` does not assess disk images correctly.
