Loading...
Loading...
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.
npx skill4agent add rudrankriyam/asc-skills asc-notarizationasc auth loginASC_*security find-identity -v -p codesigning | grep "Developer ID Application"codesignxcodebuild# Check for custom trust settings
security dump-trust-settings 2>&1 | grep -A1 "Developer ID"
# If overrides exist, export the cert and remove them
security find-certificate -c "Developer ID Application" -p ~/Library/Keychains/login.keychain-db > /tmp/devid-cert.pem
security remove-trusted-cert /tmp/devid-cert.pemcodesign --deep --force --options runtime --sign "Developer ID Application: YOUR NAME (TEAM_ID)" /path/to/any.app 2>&1xcodebuild archive \
-scheme "YourMacScheme" \
-configuration Release \
-archivePath /tmp/YourApp.xcarchive \
-destination "generic/platform=macOS"<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>developer-id</string>
<key>signingStyle</key>
<string>automatic</string>
<key>teamID</key>
<string>YOUR_TEAM_ID</string>
</dict>
</plist>xcodebuild -exportArchive \
-archivePath /tmp/YourApp.xcarchive \
-exportPath /tmp/YourAppExport \
-exportOptionsPlist ExportOptions.plist.appcodesign -dvvv "/tmp/YourAppExport/YourApp.app" 2>&1 | grep -E "Authority|Timestamp"ditto -c -k --keepParent "/tmp/YourAppExport/YourApp.app" "/tmp/YourAppExport/YourApp.zip"asc notarization submit --file "/tmp/YourAppExport/YourApp.zip"asc notarization submit --file "/tmp/YourAppExport/YourApp.zip" --waitasc notarization submit --file "/tmp/YourAppExport/YourApp.zip" --wait --poll-interval 30s --timeout 1hasc notarization status --id "SUBMISSION_ID" --output tableasc notarization log --id "SUBMISSION_ID"curl -sL "LOG_URL" | python3 -m json.toolasc notarization list --output table
asc notarization list --limit 5 --output tablexcrun stapler staple "/tmp/YourAppExport/YourApp.app"# Create DMG
hdiutil create -volname "YourApp" -srcfolder "/tmp/YourAppExport/YourApp.app" -ov -format UDZO "/tmp/YourApp.dmg"
xcrun stapler staple "/tmp/YourApp.dmg"| Format | Use Case |
|---|---|
| Simplest; zip a signed |
| Disk image for drag-and-drop install |
| Installer package (requires Developer ID Installer certificate) |
.pkgproductsign --sign "Developer ID Installer: YOUR NAME (TEAM_ID)" unsigned.pkg signed.pkgasc notarization submit --file signed.pkg --waitmethod: developer-id--timestampcodesignxcodebuild -exportArchiveASC_UPLOAD_TIMEOUT=5m asc notarization submit --file ./LargeApp.zip --waitasc notarization log --id "SUBMISSION_ID"asc notarizationxcrun notarytoolasc--helpasc notarization submit --help