我正在使用 azure pipeline 为 iOS 创建 CI,我的存储库依赖于 swift 代码,运行构建后,我在 Xcode 存档任务中收到此错误
Error Domain=IDEFoundationErrorDomain Code=1 "No 'teamID' specified and no team ID found in the archive" UserInfo={NSLocalizedDescription=No 'teamID' specified and no team ID found in the archive}
我在 Xcode 存档任务中使用 arg
steps:
- task: Xcode@5
displayName: 'Xcode archive'
inputs:
actions: archive
xcWorkspacePath: '*.xcworkspace'
scheme: '$(SchemeName)'
packageApp: true
args: '-UseModernBuildSystem=0 '
您可能需要将
exportOptions
设置为 specify
并为 Xcode 任务设置属性 teamId
和 exportMethod
。请参阅下面的示例:
steps:
- task: Xcode@5
displayName: 'Xcode archive'
inputs:
actions: archive
xcWorkspacePath: '*.xcworkspace'
scheme: '$(SchemeName)'
packageApp: true
args: '-UseModernBuildSystem=0'
exportOptions: 'specify'
exportMethod: 'app-store'
teamId: "Team Id"
exportTeamId: "Team Id"
有关 xcode 任务的更多信息,请参阅此处。
安装证书和配置文件
要签署您的应用程序,您需要安装我们已作为 Secure-Files
导入到 Azure 仪表板中的证书和配置文件- task: InstallAppleCertificate@2
inputs:
# Select the certificate (.p12) that was uploaded to Secure Files to install on the macOS agent.
certSecureFile: 'Certificate.p12'
# Password to the Apple certificate (.p12). Use a new build variable with its lock enabled on the Variables tab to encrypt this value.
certPwd: '$(P12password)'
# Select the keychain in which to install the Apple certificate. You can choose to install the certificate in a temporary keychain (default), the default keychain or a custom keychain. A temporary keychain will always be deleted after the build or release is complete.
keychain: 'temp'
# Select to delete the certificate from the keychain after the build or release is complete. This option is visible when custom keychain or default keychain are selected.
deleteCert: true
- task: InstallAppleProvisioningProfile@1
inputs:
# Select the location of the provisioning profile to install. The provisioning profile can be uploaded to Secure Files or stored in your source repository or a local path on the agent.
provProfileSecureFile: 'my-provisioning-profile.mobileprovision'