Shifting from altool to notarytool for Mac notarization

That is an replace to my 2018 article Find out how to notarize your software program on macOS.

I’ve been utilizing altool to notarize my Mac apps for some years. Nevertheless Apple, being Apple, have deprecated altool in favour of the brand new notarytool. altool will cease working sooner or later in 2023. And Apple, being Apple, have made little try to hold consistency between the 2.

I didn’t discover something on-line to inform me how arguments between the 2 instruments associated. Consequently I spent some time attempting to guess which arguments mapped to which. I bought locked out for some time for attempting to mistaken mixture too many instances. Ultimately I went from this:

xcrun altool -t osx -f <mydmg>.dmg --primary-bundle-id <com.firm.product> --notarize-app --username <apple-account-email> --password <password>

... look forward to approval electronic mail ...

xcrun altool --username <apple-account-email> --password <password> --notarization-info <RequestUUID>

To this:

xcrun notarytool submit <mydmg>.dmg --apple-id <apple-account-email> --team-id <teamid> --password <password> --verbose --wait 

On the plus aspect the --wait possibility doesn’t exit till the notarization is full, which suggests you may simply do you entire construct, signal and notarize course of in a single script. Hoorah.

Notice that you just nonetheless have to run the ‘stapling’ step after notarization:

xcrun stapler staple -v <mydmg>.dmg

Extra particulars on notarytool arguments at:

https://keith.github.io/xcode-man-pages/notarytool.1.html