从 2021 年 2 月开始,所有用户都需要进行两步验证或两步验证才能登录 App Store Connect ( https://developer.apple.com/support/authentication/ )。
目前我们按照install4j文档的描述进行公证,其中 install4j 被配置为为我们完成整个公证过程:启用公证,在配置中提供 codeSigning 证书和 apple id,身份验证密码由 --apple-id 提供CI 环境中的 -password 命令行参数。
当我们的 CI 构建尝试进行身份验证以上传本机 dmg 以进行公证时,为我们的帐户启用两个因素现在会导致问题,因为验证码 SMS 现在已发送到我们的手机。
我们如何配置 install4j 以使用 2 因素 Apple ID 帐户进行公证?
构建输出:
[INFO] install4j: compilation failed. Reason: We are unable to create an authentication session. (code -22016)
[INFO] Uploading my-app.dmg for notarization
Failed to execute goal org.sonatype.install4j:install4j-maven-plugin:1.1.2:compile (compile-installers) on project native-installer: null returned: 1