适用于 iOS 的 Azure DevOps Pipeline 集成错误:(xcodebuild 失败,返回代码:65)

Ani*_*ngh 5 continuous-integration flutter azure-devops azure-pipelines

我正在尝试为 flutter iOS 创建一个 ci/cd 管道。我期待一个签名的 .ipa 文件。

尝试签名时,我在 Xcode@5 任务中遇到错误。

这是我的管道任务:

- task: InstallAppleCertificate@2
  displayName: "Install Apple p12 cert"
  inputs:
    certSecureFile: "app.p12"
    certPwd: "$(certpassword)"
    keychain: "temp"

- task: InstallAppleProvisioningProfile@1
  displayName: "Install Apple Mobile Provisioning Profile"
  inputs:
    provisioningProfileLocation: "secureFiles"
    provProfileSecureFile: "app.mobileprovision"

- task: Xcode@5
  displayName: "Code Sign ipa for Distribution"
  inputs:
    actions: "build"
    scheme: "Runner"
    sdk: "$(sdk)"
    configuration: "$(configuration)"
    xcWorkspacePath: "ios/Runner.xcworkspace"
    xcodeVersion: "default"
    packageApp: true
    signingOption: "manual"
    signingIdentity: "$(APPLE_CERTIFICATE_SIGNING_IDENTITY)"
    provisioningProfileUuid: "$(APPLE_PROV_PROFILE_UUID)"
Run Code Online (Sandbox Code Playgroud)

xcode 任务中出现以下错误:

{ platform: iOS Simulator, id:C5BCE86E-E6C0-4E64-AE49-005808F2918E, OS:16.0, name: iPhone 11 Pro Max }
{ platform: iOS Simulator, id:63A63B15-4DBA-41CC-B2A4-373DE87483F2, OS:16.0, name: iPhone 12 }
{ platform:iOS Simulator, id:109D2750-4DB7-4723-85A6-2F446F38CAE7, OS:16.0, name: iPhone 12 Pro }
{ platform:iOS Simulator, id:C07FB95C-CDF1-485D-AB69-52AA17323958, OS:16.0, name: iPhone 12 Pro Max }
{ platform:iOS Simulator, id:74A7A1DC-39F0-4DF9-920B-D37A10F8809F, OS:16.0, name: iPhone 12 mini }
{ platform:iOS Simulator, id:C34176C6-5E17-4A67-846F-023FAA893238, OS:16.0, name: iPhone 13 }
{ platform:iOS Simulator, id:D39E5CB7-108C-4F23-ACF3-C3AB576E160A, OS:16.0, name: iPhone 13 Pro }
{ platform:iOS Simulator, id:7A2F0E11-F5D0-4939-B52B-3E47408C027E, OS:16.0, name: iPhone 13 Pro Max }
{ platform:iOS Simulator, id:707D3B43-AA06-41C2-92A1-500A608C6525, OS:16.0, name: iPhone 13 mini }
{ platform:iOS Simulator, id:E67DAAAB-AF35-4922-9CA6-04030A5566FA, OS:16.0, name: iPhone 14 }
{ platform:iOS Simulator, id:BE0F9CD6-EF7B-4550-B098-AB47F8E58C95, OS:16.0, name: iPhone 14 Plus }
{ platform:iOS Simulator, id:A2D88E3C-A916-4345-B20D-CF39E3F4D076, OS:16.0, name: iPhone 14 Pro }
{ platform:iOS Simulator, id:F6D2C7E3-B6D4-464C-A931-33DC57689DA5, OS:16.0, name: iPhone 14 Pro Max }
{ platform:iOS Simulator, id:DC572178-ED3D-4F57-9297-70D751A2797F, OS:16.0, name: iPhone SE (2nd generation) }
{ platform:iOS Simulator, id:E7631040-2CCB-447E-8F39-120F8C714735, OS:16.0, name: iPhone SE (3rd generation) }
    Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
** BUILD FAILED **

##[error]Error: /usr/bin/xcodebuild failed with return code: 65
Run Code Online (Sandbox Code Playgroud)

小智 1

最有可能的是尝试签署依赖项。您应该尝试将这些行添加到 Podfile 中。

installer.pods_project.build_configurations.each do |config|
    config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
    config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
  end
Run Code Online (Sandbox Code Playgroud)