How to create and notarize dmg file

Issue #753

  • Archive and export app from Xcode
  • Create dmg
  • Use create-dmg
    It is said that we don’t need to notarize the app, we can just notarize the whole dmg
  • Send dmg to notarize

This takes a while

1
xcrun altool -t osx -f PastePal.dmg --primary-bundle-id com.onmyway133.PastePal --notarize-app -u onmyway133@gmail.com -p APP_SPECIFIC_PASSWORD --asc-provider "T78DK947F2"

If wrong password, you will get error

Error: code -1011 (Failed to authenticate for session: (
“Error Domain=ITunesConnectionAuthenticationErrorDomain Code=-22938 "Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one, go to appleid.apple.com" UserInfo={NSLocalizedRecoverySuggestion=Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one, go to appleid.apple.com, NSLocalizedDescription=Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one, go to appleid.apple.com, NSLocalizedFailureReason=App Store operation failed.}”
) Unable to upload your app for notarization.)

It succeeds, you will get ticket ID

1
Downloaded ticket has been stored at file:///var/folders/mn/whdh16qj6jldpcdpgyjhp35m0000gn/T/51e3b8bb-1b86-4cd6-abcd-bca469561234.ticket.
  • Check notarization info
1
xcrun altool –-notarization-info TICKET_ID -u "onmyway133@gmail.com"
  • Staple the dmg

Once we have the dmg notarized, we need to staple it

1
xcrun stapler staple -v PastePal.dmg

Read more


Updated at 2021-02-12 23:17:28

Comments