asc-notarization

Archive, export, and notarize macOS apps using xcodebuild and asc. Use when you need to prepare a macOS app for distribution outside the App Store with Developer ID signing and Apple notarization.

By rorkai · 6,093 installs

npx skills add rorkai/app-store-connect-cli-skills --skill asc-notarization

Source repository · Upstream listing

macOS Notarization Use this skill when you need to notarize a macOS app for distribution outside the App Store. Preconditions Xcode installed and command line tools configured. Auth is configured ( asc auth login or ASC env vars). A Developer ID Application certificate in the local keychain. The app's Xcode project builds for macOS. Preflight: Verify Signing Identity Before archiving, confirm a valid Developer ID Application identity exists: If no identity is found, create one at https://developer.apple.com/account/resources/certificates/add (the App Store Connect API does not support creating Developer ID certificates). Inspect Trust Settings If codesign or xcodebuild fails with "Invalid trust settings" or "errSecInternalComponent", the certificate may have custom trust overrides that break the chain: These errors do not by themselves prove a trust override is the cause. Inspect the affected certificate before proposing a repair. Changing trust settings requires explicit authorization for that certificate; do not remove trust overrides or re sign an arbitrary app as a diagnostic step. Step 1: Archive Step 2: Export with Developer ID Create an ExportOptions plist for Developer ID distribution: Export the archive: This produces a .app bundle signed with Developer ID Application and a secure timestamp. Verify the Export Verify the exported app's existing signature and nested code, then display its signing details: Confirm: The verification command exits successfully; displaying signing details alone does not validate the signature The Authority chain is Developer ID Application → Developer ID Certification Authority → Apple Root CA, with the expected TeamIdentifier A Timestamp is present Stop before packaging or uploading if verification fails or the signing identity is unexpected. Diagnose the failure and rebuild or re export the intended app before checking again. These checks do not modify the bundle and do not establish notarization acceptance. Do not add sign or force to verification. [Apple's code signing guidance](https://developer.apple.com/library/archive/technotes/tn2206/) distinguishes recursive verification with deep from signing with deep force , which forcibly re signs nested code. Step 3: Create a ZIP for Notarization Step 4: Submit for Notarization Fire and forget Wait for result Custom polling Step 5: Check Results Status Developer Log (for failures) Fetch the log URL to see detailed issues: List Previous Submissions Step 6: Staple (Optional) After notarization succeeds, staple the ticket so the app works offline: For DMG or PKG distribution, staple after creating the container: Supported File Formats Format Use Case .zip Simplest; zip a signed .app bundle .dmg Disk image for drag and drop install .pkg Installer package (requires Developer ID Installer certificate) PKG Notarization To notarize .pkg files, you need a Developer ID Installer certificate (separate from Developer ID Application). This certificate type is not available through the App Store Connect API — create it at https://developer.apple.com/account/resources/certificates/add. Sign the package: Then submit: Troubleshooting "Invalid trust settings" during export Custom trust overrides are one possible cause. Use the read only inspection in Preflight, identify the affected certificate, and obtain authorization before changing its trust settings. "The binary is not signed with a valid Developer ID certificate" The app was signed with a Development or App Store certificate. Re export with method: developer id in ExportOptions.plist. "The signature does not include a secure timestamp" Add timestamp to manual codesign calls, or use xcodebuild exportArchive which adds timestamps automatically. Upload timeout for large files Set a longer upload timeout: Notarization returns "Invalid" but signing looks correct Fetch the developer log for specific issues: Common causes: unsigned nested binaries, missing hardened runtime, embedded libraries without timestamps. Notes The asc notarization commands use the Apple Notary API v2, not xcrun notarytool . Authentication uses the same API key as other asc commands. Files are uploaded directly to Apple's S3 bucket with streaming (no full file buffering). Files over 5 GB use multipart upload automatically. Always use help to verify flags: asc notarization submit help .