1.先給.app應(yīng)用 archive 用Developer ID證書和pp文件簽名,通過Xcode傳上去notarize
2.用package軟件打包.app生成.pkg文件;用當(dāng)前開發(fā)賬號持有者的賬號登錄developer.apple.com生成Developer ID Installer證書,安裝證書,用productsign命令和Developer ID Installer證書給.pkg包簽名
productsign --timestamp --sign "Developer ID Installer Cert" "/path/needSign.pkg" "/path/signed.pkg"
3.將簽名后的.pkg包用命令行上傳到蘋果服務(wù)進(jìn)行認(rèn)證,這里用普通開發(fā)者賬號生成一個app-specific-password跳過two-factor-authentification ; 認(rèn)證成功后開發(fā)者郵箱會收到一封郵件表明成功
成功后無需再對這個包做什么,用戶從網(wǎng)絡(luò)下載這個.pkg的安裝包,其電腦上的gatekeeper會像蘋果服務(wù)器請求獲取這個包的notarize情況,過了就表明這是個受認(rèn)證的開發(fā)者。
可能用到的命令
spctl -a -v xxx.pkg //查看app notarize情況
xcrun stapler staple xxx.pkg //感覺這個命令好像沒有作用 說的是把ticket打入到包
xcrun altool --notarize-app --primary-bundle-id "installer pkg bundleID" --username "developerAccount" --password "app-specific-password" --file "/path/xxx.pkg" //這個命令可能過時最好用下面這個
xcrun notarytool submit --apple-id "Developer Account " --password "app specific password" --team-id "XXXXXXX" "/path/xxx.pkg"
這個命令成功會返回一個RequestUUID
No errors uploading '/path/xxx.pkg'.
RequestUUID = 99c29d9e-7086-424e-af81-eb1eb7dh9f06 //根據(jù)這個RequestUUID可以后續(xù)查詢一些信息