Ab November wird Apple nur noch Notarisierungen über das Notarytool erlauben. Das folgende Skript automatisiert diesen Prozess.
Einfach ab Zeile 14 Benutzername, Passwort sowie TeamID eintragen und los geht’s.
Schlägt der Notarisierungsprozess fehl, holt sich das Skript das JSON-Log vom Apple Notarierungsserver und zeigt es an. So werden Fehler schnell gefunden.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | #!/bin/bash -u # # notarize 2.0.0 # # Notarize an macOS app bundles, DMGs and PKGs. # # CALL: # notarize file (or app bundle) # # (c)2023 Harald Schneider # Setup.start # USR="USERNAME_HERE" PWD="PASSWORD_HERE" TEAM="TEAM_ID HERE" # # Setup.end doCleanup() { echo "Cleanup ..." rm notarize.log > /dev/null 2>&1 rm devlog.json > /dev/null 2>&1 rm $FILE.zip > /dev/null 2>&1 } FILE="${1%/}" echo echo "Notarize script started ..." echo "Packing ..." ditto -ck --sequesterRsrc --keepParent $FILE $FILE.zip echo "Notarizing ..." xcrun notarytool submit $FILE.zip --apple-id=$USR --team-id=$TEAM --password=$PWD --wait|tee -a notarize.log UUID=$(awk '/id:(.*?)/ {print $2;found=1;exit}' notarize.log) echo "Extracted UUID is $UUID" echo if grep -q "Invalid" notarize.log; then echo "ERROR: Status invalid" echo "Trying to get the server's log ..." xcrun notarytool log $UUID --apple-id=$USR --team-id=$TEAM --password=$PWD devlog.json echo cat devlog.json echo doCleanup echo "KICKED OUT BY AN ERROR!" exit fi echo "Stapling ..." xcrun stapler staple $FILE doCleanup echo "DONE!" |