Notarize a Mac app
Submit with notarytool, wait for the result, and staple the ticket.
For a Mac app you distribute outside the App Store, signed with your Developer ID. Apple’s command-line steps:
1. Save your credentials once
xcrun notarytool store-credentials "notarytool-password" \
--apple-id "you@example.com" --team-id TEAMID \
--password app-specific-password
Use an app-specific password from your Apple Account, not your normal password.
2. Submit and wait
ditto -c -k --keepParent MyApp.app MyApp.zip
xcrun notarytool submit MyApp.zip --keychain-profile "notarytool-password" --wait
Most submissions finish within 5 minutes. If it’s rejected, xcrun notarytool log <id> --keychain-profile "notarytool-password" log.json says why.
3. Staple
xcrun stapler staple MyApp.app
You can’t staple a ZIP: staple the app (or DMG or package), then zip it again for distribution.