一、Mac app文件签名与公证
在钥匙串中创建要公证app的profile(公证的时候会用到)
xcrun notarytool store-credentials "mac_app" --apple-id "xxxxxxxx@163.com" --team-id "S24Z9326XX" --password "fnjx-qjoe-lksd-xxxx"
store-credentials:随便起名字,自己记住就行,后面会用
apple-id:Apple ID team-id:团队ID
https://appleid.apple.com/account/manage 可以查看到 password:App专用密码,可以在AppleID管理那里生成
1.获取打包完成后的App文件,并cd到.app所在目录
cd /Users/xxxx/Desktop/code/
2.app签名
特别注意,使用"Developer ID Application" 去签名
产看可用于用签名的证书
security find-identity -v -p codesigning
codesign -f -o runtime -s "Developer ID Application: xx (S39Z9426XX)" -v test.app/Contents/MacOS/test --deep
终端输出:signed app bundle with Mach-O thin (x86_64) [com.fjsi.test]
codesign -f -o runtime -s "Developer ID Application: xx (S39Z9426XX)" -v test.app --deep
3.app文件转为zip文件(不要右键压缩,会有mac文件系统隐藏文件)
ditto -c -k --keepParent test.app test.app.zip
4.公证,mac_app 对应公证app的profile
xcrun notarytool submit cw-navigation.app.zip --keychain-profile "mac_app" --wait
终端输出:
Submission ID received
id: ef289eb0-606b-45d3-b383-0b72490247f4
Successfully uploaded file15.3 MB of 15.3 MB)
id: ef289eb0-606b-45d3-b383-0b72490247f4
path: /Users/xx/Desktop/Payload/test.app.zip
Waiting for processing to complete.
Current status: Accepted…
Processing complete
id: ef289eb0-606b-45d3-b383-0b72490247f4
status: Accepted
根据id查看公正的信息
xcrun notarytool log "ef289eb0-606b-45d3-b383-0b72490247f4" --keychain-profile "mac_app"