How to notarize a dmg or zip file with the help of Xcode's Notary Tool?

apple app development xcode
Ram Patra Published on August 11, 2022
Xcode 13+

With Xcode 13 and later, notarization via command-line has come down to these 2 basically:

xcrun notarytool store-credentials "<key>" --apple-id "<your apple id>" --team-id <your teamid> --password "<app specific password>"


xcrun notarytool submit <your file name>.dmg --keychain-profile "<key>" --wait

The first command is used to create a keychain profile in your Keychain and the second command uses this profile and submits the file (dmg/zip) to Apple for notarization and waits until it gets a response back. You do not need to poll.

It’s a good practice to see the logs even if you get a success response.

xcrun notarytool log <id you get from the response> --keychain-profile "<key>" logs.json

Note: At the time of writing this answer, apple documentation is kind of confusing as they have mentioned using the secret 2FA password instead of the app-specific password. You can go through these steps to create an app specific password (if not already done) before running the first command.

P.S. I used this wonderful open-source tool to create my dmg file for Presentify app.

Ram Patra Published on August 11, 2022
Image placeholder

Keep reading

If this article was helpful, others might be too

apple app development xcode April 5, 2022 How to notarize your app in Xcode?

Submitting your app to the Apple App Store is somewhat “straightforward”, however, if you want to export your app to list it on a 3rd party app store or sell it directly to your customers then you have to notarize your app.