-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotarize.sh
More file actions
executable file
·67 lines (52 loc) · 1.77 KB
/
notarize.sh
File metadata and controls
executable file
·67 lines (52 loc) · 1.77 KB
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
59
60
61
62
63
64
65
66
67
#!/bin/bash
set -e
echo "🍎 Notarizing Snap with Apple"
echo "============================="
if [ $# -eq 0 ]; then
echo "Usage: $0 <apple_id_email> [app_specific_password]"
echo ""
echo "Example: $0 your.email@icloud.com"
echo ""
echo "Note: You'll need an App-Specific Password from your Apple ID account."
echo "Generate one at: https://appleid.apple.com/account/manage"
exit 1
fi
APPLE_ID="$1"
APP_SPECIFIC_PASSWORD="$2"
APP_PATH="./build/Release/snap.app"
DMG_PATH="./build/Snap-1.0.dmg"
if [ ! -d "$APP_PATH" ]; then
echo "❌ Error: App not found. Run build_distribution.sh first."
exit 1
fi
if [ -z "$APP_SPECIFIC_PASSWORD" ]; then
echo "🔐 Enter your App-Specific Password:"
read -s APP_SPECIFIC_PASSWORD
fi
echo "📤 Uploading app for notarization..."
xcrun notarytool submit "$DMG_PATH" \
--apple-id "$APPLE_ID" \
--password "$APP_SPECIFIC_PASSWORD" \
--team-id "Z8988US23Z" \
--wait
echo "🔍 Checking notarization status..."
SUBMISSION_ID=$(xcrun notarytool history \
--apple-id "$APPLE_ID" \
--password "$APP_SPECIFIC_PASSWORD" \
--team-id "Z8988US23Z" \
--output-format json | \
jq -r '.submissions[0].id')
xcrun notarytool log "$SUBMISSION_ID" \
--apple-id "$APPLE_ID" \
--password "$APP_SPECIFIC_PASSWORD" \
--team-id "Z8988US23Z"
echo "📎 Stapling notarization ticket to app..."
xcrun stapler staple "$APP_PATH"
echo "📎 Stapling notarization ticket to DMG..."
xcrun stapler staple "$DMG_PATH"
echo "✅ Verifying stapled app..."
xcrun stapler validate "$APP_PATH"
xcrun stapler validate "$DMG_PATH"
echo "🎉 Notarization complete!"
echo "Your app is now fully notarized and ready for distribution."
echo "Users will not see any security warnings when running your app."