# Notarize a Mac app you signed yourself

> Attach a Mac app you signed with your Developer ID, have an Agent send it to Apple's notary service, read the log if Apple turns it down, and staple the ticket to the file.

Source: https://air.build/docs/build/notarize-a-mac-app-you-signed/

If you give out a Mac app yourself, for example as a download from your website, Apple's notary service checks it and gives back a ticket. An Agent can send your signed app to the notary service, tell you what Apple said, and staple the ticket to the file so it travels with the app. Apple explains what notarization checks and when you need it in [Notarizing macOS software before distribution](https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution).

> [!NOTE]
> AirBuild doesn't sign Mac apps with Developer ID, and doesn't make Developer ID certificates. In AirBuild, `asc certificates create` makes only Wallet pass and Apple Pay certificates, and AirBuild's own signed builds are for TestFlight and the App Store. Sign the app yourself with your Developer ID certificate first: see Apple's [Developer ID certificates](https://developer.apple.com/help/account/certificates/create-developer-id-certificates/).
>
> AirBuild has no screen for notarization. You ask an Agent in the Project's chat, and it uses `asc notarization` (see notarization in [asc: signing, devices and users](https://air.build/docs/cli/asc-signing/#notarization)).

> [!NOTE]
> Apple's [Developer ID certificates](https://developer.apple.com/help/account/certificates/create-developer-id-certificates/) page says making a Developer ID certificate needs the Account Holder role in your Apple Developer team.

## Before you start

- The Team's owner has connected an Apple Developer account and switched a team on. The Agent sends the app to Apple with that team. See [Connect your Apple Developer account](https://air.build/docs/app-store/connect-apple-developer-account/).
- Your app is signed with your Developer ID. Apple's page above lists what else the notary service needs from the app.
- The file is a `.zip`, `.dmg` or `.pkg`: those are the three kinds the command takes. If you attach an `.app`, AirBuild attaches it as a zip of itself (for example `MyApp.app.zip`). If Apple says the signature isn't valid, zip the app yourself as Apple's [Customizing the notarization workflow](https://developer.apple.com/documentation/security/customizing-the-notarization-workflow#Export-a-package-for-notarization) shows, or make a disk image, and attach that.

## Send it to Apple

1. Attach the file to a message in the Project's chat. See [Send photos, files and sketches to an Agent](https://air.build/docs/projects/send-photos-and-files/).

2. Ask, for example:

   ```text
   Notarize the attached Mac app, staple the ticket, and send me the stapled file.
   ```

3. The Agent sends it with `asc notarization submit --wait`. The help says the command uploads the file to Apple and, with `--wait`, waits for Apple's result. If it stops waiting first, see the timed-out question below.

4. It tells you Apple's answer and the submission's ID. The status is one of `Accepted`, `In Progress`, `Invalid` or `Rejected`.

Sending the file doesn't change it. When the status is `Accepted`, the Agent goes on to [staple the ticket](https://air.build/docs/build/notarize-a-mac-app-you-signed/#staple-the-ticket).

## If Apple doesn't accept it

When the status is `Invalid` or `Rejected`, the command says "Notarization failed" and points to the log. Ask:

```text
Why didn't Apple accept it? Show me what the notarization log says.
```

The Agent reads the log with `asc notarization log --fetch`. The help says the log has "detailed information about the notarization result, including any issues found during the scan." The Agent can sum it up in the chat, or save it as a file (`--path`) and send it to you.

You signed the app, so the fix is on your side: sign it again with what the log asks for, attach the new file and ask again. Apple lists the usual problems and their fixes in [Resolving common notarization issues](https://developer.apple.com/documentation/security/resolving-common-notarization-issues).

## Staple the ticket

Stapling attaches Apple's ticket to your file. The help says `asc notarization staple` attaches it and checks it straight after. It changes the file itself, so it runs only with `--confirm`, and the Agent asks you first.

- What can be stapled: a notarized app bundle (`.app`), a disk image (`.dmg`) or a signed installer package (`.pkg`). A `.zip` can't be stapled: the help says to staple the item inside it and zip it again. The Agent does that for you.
- Where it runs: the help says stapling runs only on a Mac, and Apple's stapler may need the internet. In a local Team, the Agents work on your Mac, so the Agent staples there. In a cloud Team, this page doesn't know whether the Agent can staple. If it says the stapler "is supported on macOS only", staple the file yourself on your Mac: Apple's [Customizing the notarization workflow](https://developer.apple.com/documentation/security/customizing-the-notarization-workflow) shows how. See [Choose where your Agents run](https://air.build/docs/get-started/where-agents-run/).

The Agent sends the stapled file back in the chat. Touch and hold it (on the Mac, right-click it) and choose **Save As…**. On the Mac, clicking a `.pkg` or `.dmg` in the chat shows it in Finder instead of opening it. See [Send photos, files and sketches to an Agent](https://air.build/docs/projects/send-photos-and-files/#open-files-in-the-chat).

To check a file later, ask "Does the attached app have a stapled ticket?" The Agent checks with `asc notarization validate`, which doesn't change the file and also runs only on a Mac.

## Check on a submission later

| Ask | `asc` |
| --- | --- |
| "Where does my notarization stand?" | `notarization status`, with the submission's ID. |
| "List my last five notarizations." | `notarization list`, with `--limit`. |
| "Show me the log for the last notarization." | `notarization log`, with the submission's ID. Without `--fetch`, it gives a link to the log instead of its contents. |

## Questions

**Can an Agent sign my Mac app with Developer ID?**

No. AirBuild holds your team's distribution and development certificates and signs TestFlight and App Store builds with them, but it doesn't sign with Developer ID. Asked to make a Developer ID certificate, `asc certificates create` says the type "is a signing certificate, which Airbuild manages". Sign the app yourself, then attach it.

**The Agent says the file type isn't supported.**

The message is "unsupported file type … (must be .zip, .dmg, or .pkg)". Zip the app, or put it in a disk image or an installer package, and attach that.

**The Agent says the file must not be empty.**

The file arrived with nothing in it. Attach it again in a new message.

**The Agent timed out waiting for notarization.**

The message starts "timed out waiting for notarization". The file was already uploaded, and Apple goes on checking it. Ask "Where does my notarization stand?" a little later.

**The Agent says zip archives can't be stapled.**

The message is "zip archives cannot be stapled or validated directly; staple the contained item and recreate the archive". Ask the Agent to staple the app inside the zip and zip it again.

**The Agent says the stapler is supported on macOS only.**

Stapling runs only on a Mac. Staple the file yourself on your Mac (see Apple's [Customizing the notarization workflow](https://developer.apple.com/documentation/security/customizing-the-notarization-workflow)), or use a local Team, whose Agents work on your Mac.

**The Agent says xcrun is not available.**

The message goes on: "install Xcode and ensure the active developer directory is configured". In a local Team, install Xcode on the Mac and choose it in **Xcode ▸ Settings ▸ Locations ▸ Command Line Tools**. See [Choose where your Agents run](https://air.build/docs/get-started/where-agents-run/#set-up-your-mac-for-a-local-team).

**Will my Developer ID certificate keep working?**

Ask "Are any of my Developer ID certificates affected by the February 2027 expiry?" The Agent checks with `asc certificates developer-id-check`. Its help says certificates from the original Developer ID Certification Authority stop working on February 1, 2027, that `.pkg` installers signed with them no longer install, and to replace them with certificates from Developer ID Certification Authority (G2). Each certificate comes back as `affected`, `not-affected`, `likely-affected` or `unknown`.
