Mac app文件签名与公证

编程入门 行业动态 更新时间:2024-10-11 19:17:53

Mac app<a href=https://www.elefans.com/category/jswz/34/1771438.html style=文件签名与公证"/>

Mac app文件签名与公证

一、Mac app文件签名与公证

在钥匙串中创建要公证app的profile(公证的时候会用到)

xcrun notarytool store-credentials "mac_app" --apple-id "xxxxxxxx@163" --team-id "S24Z9326XX" --password "fnjx-qjoe-lksd-xxxx"

store-credentials:随便起名字,自己记住就行,后面会用
apple-id:Apple ID team-id:团队ID
可以查看到 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"

更多推荐

Mac app文件签名与公证

本文发布于:2024-02-13 20:30:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1760457.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   Mac   app

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!