Last active
May 13, 2020 16:01
-
-
Save stevesparks/714219a5ef2524605762fec3e92fcd3c to your computer and use it in GitHub Desktop.
Apple Mac notarization script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## | |
## CHANGE THESE FOR YOUR NEEDS | |
## | |
APPLE_USER=your@username.here | |
APPLE_PASS=apple-app-specific-password | |
APPNAME="$1" | |
ZIPNAME="$APPNAME.zip" | |
echo Creating ZIP file... | |
ditto -c -k --rsrc --keepParent "$APPNAME" "$ZIPNAME" | |
echo Submitting app for notarization. | |
result=`xcrun altool --notarize-app --primary-bundle-id com.peloton.crescendo --username $APPLE_USER --password $APPLE_PASS --file "$ZIPNAME" 2>&1` | |
uuid=`echo $result | grep RequestUUID | sed -e 's/^No errors uploading.*RequestUUID = \([0-9A-F-]*\)/\1/'` | |
echo UUID : $uuid | |
statuscommand="xcrun altool --notarization-info $uuid --username $APPLE_USER --password $APPLE_PASS" | |
echo Status command is: | |
echo " $statuscommand" | |
result="in progress" | |
logurl="" | |
while [ "$result" = "in progress" ]; do | |
echo Sleeping for 60 before checking. | |
sleep 60 | |
statusoutput=`$statuscommand` | |
result=`echo $statusoutput | grep Status | sed -e 's/.*Status: \(.*\)/\1/'` | |
logurl=`echo $statusoutput | grep LogFileURL | sed -e 's/.*LogFileURL: \(.*\)/\1/'` | |
done | |
echo Final status: $result | |
echo "" | |
echo Notarization log file URL: $logurl | |
# do something here -- look for warnings | |
#logcontents=`curl -s $logurl` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment