Mac app文件签名与公证
-
在钥匙串中创建要公证app的profile(公证的时候会用到)
xcrun notarytool store-credentials "mac_app" --apple-id "xxxxxxxx@qq.com" --team-id "S24Z9326XX" --password "asgt-qjoe-tjep-xxxx"store-credentials:随便起名字,自己记住就行,后面会用
apple-id:Apple ID
team-id:团队ID developer.apple.com/account/ 可以查看到
password:App专用密码,可以在AppleID管理那里生成
-
获取打包完成后的App文件,并cd到当前目录
cd /Users/xxxx/Desktop/my_codes/Rust/cw-navigation/src-tauri/target/release/bundle/macos -
app签名
codesign -f -o runtime -s "Developer ID Application: W L (S24Z9326XX)" -v cw-navigation.app --deep
-
app文件转为zip文件(不要右键压缩,会有mac文件系统隐藏文件)
ditto -c -k --keepParent cw-navigation.app cw-navigation.app.zip -
公证
xcrun notarytool submit cw-navigation.app.zip --keychain-profile "mac_app" --wait -
可以查看公证记录(报错时,可以查看具体报错信息)
xcrun notarytool log "c5d0e8b4-f8ce-4104-90a2-78054bdb11c8" --keychain-profile "mac_app" # 公证时会返回有个id 通过这个id查询
参考资料