我已经能够解决我的公证问题。我不知道这是否是“正确的方式”,但它奏效了,所以这就是我所做的——也许它会为别人节省我所经历的时间和挫折。
背景:我是一名承包商,在我的客户的 Apple Developer 帐户上拥有“管理员”权限,同时我还拥有一个个人 ADC 帐户。如我的问题所述,Electron Builder
文档声明需要“应用程序特定密码”,并链接到有关如何生成密码的 Apple 文档。但是,该链接正在或似乎是关于生成特定密码以与“Twitter”等第三方应用程序一起使用 - 这样一个人的个人 Apple ID 密码就会受到保护。至少我是这么读的。在我的个人 ADC 帐户或团队帐户中没有可以生成此类密码的地方。所以我在我的个人 ADC 帐户中生成了一个密码。
来自Electron Builder的这篇文章引入了一个附加属性来传递给notarize
:“ProviderShortname”。如帖子中所述,可以通过以下方式访问:
xcrun altool --list-providers -u <personal APPLE ID> -p <app-specific pw generated within that acct>
这给出了成员列表。然后,我在下面的代码中使用 Team ID 作为“ascProvider”的值:
require('dotenv').config();
const { notarize } = require('electron-notarize');
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== 'darwin') {
return;
}
const appName = context.packager.appInfo.productFilename;
return await notarize({
appBundleId: 'com.xxx.yyy.zzz',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
ascProvider: process.env.ASCPROVIDER
});
};
该应用程序成功公证(Apple 会发送一封确认电子邮件),然后继续进行其余的打包工作。在公证收据被“装订”到应用程序之后,我还遇到了一些创建问题dmg
(这在我尝试公证应用程序之前没有发生)。这些问题与缺少必需的“消息”和“语言”代码(在我的情况下为“en-us”)有关。我通过添加示例“Electron Builder”来解决它,如下所示。
同样,我不知道这是否是处理所有这些问题的“正确方法”——但它确实有效。我想如果一个人是个人开发人员而不是团队的一部分,那么样板的 Electron Builder 说明就可以了。
{
"languageName": "English",
"lang": "en-us",
"agree": "Agree",
"disagree": "Disagree",
"print": "Print",
"save": "Save",
"description": "",
"message": "If you agree with the terms of this license, press 'Agree' to install the software. If you do not agree, press 'Disagree'"
}