Skip to content
tezvyn:
Menu

macOS App Notarization: Apple's Security Checkpoint

Source: developer.apple.comHardHow cards are made

macOS App Notarization: Apple's Security Checkpoint

Notarization is an automated security screening for macOS apps. You upload your app, Apple scans it for malware, and issues a ticket to attach to it. This is mandatory for apps distributed outside the Mac App Store.

Why it exists

To protect users from malicious software distributed outside the curated Mac App Store. Before notarization, macOS Gatekeeper could only verify if an app was from a registered developer, not if the code itself was harmful. Notarization adds an automated malware scan by Apple as a prerequisite for launch.

The mental model

Think of notarization as getting a passport for your app. You sign your app with your Developer ID (its birth certificate). You then submit it to Apple (the passport office), who verifies it's not on a watchlist (malware scan) and issues a notarization ticket (the passport). A user's Mac (border control) checks for this passport before letting the app run, giving the user confidence it's safe.

How it works

The process has three key steps. First, you must code sign your app with a Developer ID certificate. Second, you archive your app (e.g., into a .zip or .dmg) and upload it to Apple's notary service using a command-line tool like notarytool. Third, after Apple's service approves it, you receive a ticket. You must then "staple" this ticket to your app package using the stapler tool so Gatekeeper can verify it offline.

When to use it

It is mandatory for all software distributed for macOS outside the Mac App Store. This includes apps, plug-ins, kernel extensions, and even the disk images they are distributed on. Without notarization, Gatekeeper will block the app from launching on modern macOS versions and show the user a stern warning.

When not to use it

You do not need to notarize apps distributed exclusively through the Mac App Store, as they undergo a more comprehensive App Review process. You also don't notarize builds intended for local development and testing on your own machine.

One canonical example

A developer builds a utility and wants to sell it from their website. They first archive and sign the app. Then, they run a command like xcrun notarytool submit MyApp.zip --keychain-profile "MyProfile" --wait. After the service returns success, they run xcrun stapler staple "MyApp.app" to attach the ticket. The final, stapled app is then zipped and ready for distribution.

Interview question

What is the main reason for "stapling" a macOS application after Apple's notarization service approves it?

  • a.To digitally sign the application with the developer's ID.
  • b.To upload the application package to Apple's notary service.
  • c.To enable Gatekeeper to verify the notarization ticket offline.Correct
  • d.To encrypt the application bundle for secure distribution.
Why?

Stapling attaches the notarization ticket directly to the app package, allowing Gatekeeper to verify its authenticity even without an internet connection. Options A and B describe earlier, distinct steps in the notarization process, not the purpose of stapling.

Just read this? Test yourself on what you have been reading.

Read the original → developer.apple.com

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles