2026 headless remote Mac notarization notarytool choices
CI/CD & Mobile 2026-04-02

2026 Headless Remote Mac Notarization Pipelines: notarytool App Store Connect API vs Keychain Profile + stapler & notarytool log SSH Troubleshooting Decision Table & FAQ

Turn notarization from “works on my GUI machine” into an auditable pipeline: pick the right notarytool auth model first, then split triage between stapler and notarytool log. This post targets SSH-driven remote Macs and CI runners with comparison tables and symptom-first decision matrices you can paste into a runbook.

1. Why default to notarytool in 2026

Apple has moved developers from legacy altool to notarytool (bundled with Xcode and the Command Line Tools). On a headless remote Mac, the payoff is a single CLI for submit, history, and detailed logs—scriptable and runbook-friendly—instead of brittle upload paths or manual web clicks.

Keep the mental model to three steps: sign the artifact → notarytool submit (capture submission ID) → poll until success → (optional) stapler staple to embed the ticket on disk. Where you store credentials determines whether that loop is stable under SSH.

2. Two auth paths: App Store Connect API keys vs Keychain profiles

2.1 App Store Connect API (Issuer ID + Key ID + .p8)

Create an API key under App Store Connect → Users and Access → Keys, download the .p8 (one-time). notarytool consumes it via --key, --key-id, and --issuer. Typical advantages:

  • Non-interactive: no Apple ID password or SMS/device 2FA—CI-friendly.
  • Rotation and revocation: clear key lifecycle and smaller blast radius if leaked.
  • Scoped permissions: role boundaries that audit well.

Operationally, place the .p8 in a locked-down path (mode 600) or inject it from a secret manager, and never commit it to Git. The same layering mindset applies when you wire multiple providers and secrets in automation—see 2026 OpenClaw Multi-Model & API Keys in Practice: MiniMax, Qwen Provider Wiring + Remote Mac SSH FAQ for a concrete pattern of separating credentials from code and validating them over SSH.

2.2 Keychain profile (notarytool store-credentials)

notarytool store-credentials can store Apple ID or API material as a named profile in the login keychain, then you call --keychain-profile "name". That fits interactive one-time setup reused under the same user session.

On remote headless hosts, watch for mismatches when SSH non-login shells, daemons, or concurrent jobs disagree on keychain unlock state or which user owns the login keychain—leading to “manual works, pipeline flakes.” When you also expose admin paths over zero-trust tunnels, keep build secrets off the same exposure surface; the split-tunnel playbook in 2026 OpenClaw Gateway Zero-Exposure: Tailscale Serve/Funnel vs Cloudflare Tunnel (cloudflared) + Remote Mac SSH Playbook & FAQ is a useful parallel for isolating management plane vs build plane.

3. Decision table (copy into your runbook)

Dimension ASC API key (.p8) Keychain profile
Headless / CI fit High: flags or env injection Medium: depends on unlock + user context
Credential rotation Swap key, update pipeline vars Update keychain item or recreate profile
Concurrent jobs Shared .p8 per job (mind permissions / locking) ACL and session contention are common
Compliance / audit Key IDs and issuance trail are explicit Extra bookkeeping: which host, which user
Typical fit Shared runners, rented Mac nodes, many repos Solo dev machines with a stable login session

Takeaway: for team-scale remote Mac notarization in 2026, default to ASC API + .p8; prefer profile-only flows only when you can guarantee the same macOS user and reliable keychain unlock.

4. stapler vs notarytool log: triage split over SSH

They answer different questions: stapler is about whether the on-disk bundle carries a ticket and looks coherent to Gatekeeper; notarytool log <submission-id> is about Apple’s server-side verdict for that submission, including structured failure reasons.

Symptom (common over SSH) First action Why
notarytool submit returns Invalid / Rejected Pull notarytool log <id> (or use history to find the id) Root cause lives in server scan results; stapler cannot show it
Status Accepted, but downloads still say “not notarized” stapler staple the shipped artifact, then stapler validate Ticket missing inside DMG/ZIP/nested app, or wrong unstapled copy shipped
Need a quick gate: “does this file on disk have a ticket?” stapler validate / spctl-style checks No API round-trip; good for fast preflight
Same script “sometimes green, sometimes red” Pin submission IDs and diff logs; then check keychain, concurrency, proxies Flakes often trace to credential context or upload integrity; logs separate repeated cause vs environment drift

5. FAQ: headless notarization pitfalls

Q1: CI says it cannot access the keychain or the profile is missing?

Suspect first: the job user differs from the one where you ran store-credentials, or the login keychain is locked. Next: switch to the ASC API triplet; if you must keep a profile, run the runner under launchd with explicit unlock and serialize signing/notarization stages.

Q2: Accepted, but stapler errors?

Suspect first: wrong staple target (e.g., staple the app before re-wrapping DMG), or read-only path / sandbox limits. Next: align with Apple’s supported formats for stapling and confirm the pipeline touches the same path you validated.

Q3: Log mentions signing, Hardened Runtime, or entitlements?

Suspect first: pre-notarization signing and declared entitlements disagree (including nested helpers). Next: reproduce on the same remote Mac, compare codesign -dvvv and entitlements, fix, then resubmit—avoid “fixed locally, CI still runs the old script.”

Q4: Corporate proxy breaks uploads?

Suspect first: proxy blocks or MITMs Apple upload endpoints. Next: allowlist or bypass for the builder; from SSH, test a tiny submit to validate TLS before pushing large artifacts.

Why run this pipeline on a Mac mini?

notarytool, codesign, and stapler are first-class macOS toolchain pieces; on an Apple Silicon Mac mini you get the same runtime and security stack Apple expects for notarization, without re-deriving edge cases on foreign OSes. Unified memory and roughly single-digit-watt idle power also suit always-on remote builders: quiet, cool, and inexpensive to leave connected when queues go idle.

For teams, Gatekeeper, SIP, FileVault, and file-permission models make it easier to state who may submit from which host—exactly the compliance story that is hard to fake on generic VMs. If you are wiring archive → sign → notarize end-to-end, a dedicated Mac mini M4 is often the most cost-effective real-hardware anchor; get a remote Mac now and turn this runbook into consistently green builds.

Recommended Plans

M4.S Best Seller

10-Core 16GB 256GB
$105.9
/ mo
View All Plans