我已经通过命令行成功为我正在为其开发插件的 Mac 应用程序公证了一个插件。此插件旨在用于 Mac appstore 之外的分发。
xcrun altool --notarize-app --primary-bundle-id "com.demo.bundle.id" --username "email@abc.com" --password "xxx-x-xxxx-xx" --file Plugin.zip
收到一封已成功公证的电子邮件,并且该电子邮件包含有关如何导出以进行分发的说明。但是,这是 XCode UI 的说明,但我通过命令行进行了公证,因此说明不适用于我。是否有用于下载公证文件(Plugin.zip
)的命令行,或者如何Plugin.zip
从 Apple 获取文件以将其分发到我的网站上?
更新:
事实证明,您可以对 .zip 文件进行公证,但不能装订它。所以我决定创建一个 .pkg 来分发我的插件,而不是通过 zip 文件分发。
这是我成功公证和装订我的插件所遵循的步骤,假设我的插件名称是FileConvertor.PluginExtension
- 对要包含在安装程序中的二进制文件进行代码签名。
codesign --sign "Developer ID Application: Developer Name" --verbose=4 --deep --force --strict FileConvertor.PluginExtension
- 创建您的安装程序 (.pkg) 添加上述代码签名
.PluginExtension
- 现在使用安装程序证书签署您的安装程序。
productsign --sign "Developer ID Installer: Developer Name" ./FileConvertor.pkg ./FileConvertorSigned.pkg
- 发送已签名的安装程序进行公证
xcrun altool --notarize-app --primary-bundle-id "com.demo.plugin" --username xyz@abc.com" --password "xxxx-xxxx-xxxx-xxxx" --file FileConvertorSigned.pkg
- 如果公证成功,请装订您的安装程序
xcrun stapler staple FileConvertorSigned.pkg
- 在网络上分发您的安装程序