1.Product->Archive->Direct Distribute ->Upload 歸檔應(yīng)用(必須使用原始開發(fā)者賬號(hào)登錄)
2.等待幾分鐘之后,去Organizer中去查看,導(dǎo)出已經(jīng)公證的安裝包
3.把這個(gè)公證的安裝包放到packages軟件中打包apk安裝包應(yīng)用
4.對(duì)apk簽名,必須先安裝Developer id installer證書,直接在xcode中的設(shè)置中的accounts中,選中登錄的原始賬號(hào)->Manage Certificates->點(diǎn)擊添加Developer id installer證書即可,這樣在鑰匙串中就能看到這個(gè)證書
- 簽名: productsign --sign "Developer ID Installer: xxx xxxx Co., Ltd. (Y42ZE21CL6)" Uploader_0.0.3.pkg Uploader_0.0.3_signed.pkg
6.將信息存儲(chǔ)到鑰匙串: xcrun notarytool store-credentials "xxxxxkey"
--apple-id "xxxx@xxxx.com"
--team-id Y42ZE21CL6
--password jgoa-fgss-12345-dtjx
xxxxxkey 是憑證名稱,可隨意命名,后續(xù)需要使用到
--apple-id:你注冊(cè)的Apple開發(fā)者帳號(hào),可以設(shè)置原始開發(fā)賬號(hào),也可以設(shè)置授權(quán)的子賬號(hào),這里我用的是子賬號(hào)
--team-id: teamId的值,無論是個(gè)人或公司開發(fā)者帳號(hào),都會(huì)有一個(gè)這樣的值
--password: 專屬密碼, https://appleid.apple.com 在這里設(shè)置, 這里我設(shè)置的子賬號(hào)的專屬密碼,驗(yàn)證沒問題
7.提交 xcrun notarytool submit Uploader_0.0.3_signed.pkg
--keychain-profile "xxxxxkey" \
提交成功會(huì)出現(xiàn)下面的字樣:
Successfully uploaded file.
id: 2efe2717-52ef-43a5-96dc-0797e4ca1041
path: Uploader_0.0.3_signed.pkg
8.查詢進(jìn)度:
xcrun notarytool info {id} --keychain-profile "xxxxxkey"
{id}: 上一步生成的id值
--keychain-profile: 公證憑證
提交成功會(huì)出現(xiàn)下面的字樣:
Successfully received submission info
createdDate: 2022-09-19T06:29:28.611Z
id: d6b8ad29-8517-44f6-8392-5b6a6e40b876
name: Uploader_0.0.3_signed.pkg
status: Accepted
9.蓋章 xcrun stapler staple Uploader_0.0.3_signed.pkg
10.驗(yàn)證 xcrun stapler staple -v Uploader_0.0.3_signed.pkg
正常情況下,會(huì)輸出The staple and validate action worked!的字樣.
這樣就是合法的應(yīng)用了,可以發(fā)布到官網(wǎng)用戶下載了
參考資料: https://taoofcoding.tech/blogs/2022-11-13/use-notarytool-to-notary-macos-app