Azure DevOps 服务器类型: dev.azure.com,
我正在尝试运行 Azure Pipeline
Task Name: Xcode@5
。
Xcode@5 无法构建 Xcode 项目,找不到任何与
profile_name
匹配的 iOS 应用程序开发配置文件,导致出现以下格式的代码签名错误:
error: No profiles for 'com.ahe.aheline' were found:
Xcode couldn't find any iOS App Development provisioning profiles matching 'com.ahe.aheline'.
Automatic signing is disabled and unable to generate a profile.
To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
(in target 'AHELine.UI' from project 'AHELine.UI')
注意我可以在 Xcode 上本地运行它,但它不能在 dev.azure.com 上运行,无法获取匹配的配置文件。
我们的脚本:
trigger:
- none
pool:
vmImage: 'macOS-14'
resources:
repositories:
- repository: AheLineIOS
type: git
name: AheLineIOS/AheLineIOS
trigger:
branches:
include:
- deneme
paths:
include:
- AHELine.UI/*
- AheLine.Robo/*
- AHELine.Data/*
- AHELine.Common/*
- Pods/*
exclude:
- ExportOptions_prod.plist
steps:
- checkout: AheLineIOS
clean: true
- task: PowerShell@2
displayName: Select Xcode Version
inputs:
targetType: 'inline'
script: |
echo Mac OS version:
sw_vers -productVersion
echo Installed Xcode versions:
ls /Applications | grep 'Xcode'
echo currently selected xcode:
xcrun xcode-select --print-path
echo selecting latest xcode...
sudo xcode-select -s /Applications/Xcode_15.0.1.app
xcrun xcode-select --print-path
echo Selected Xcode version:
xcodebuild -version
xcodebuild -downloadAllPlatforms
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'Certificates2023.p12'
certPwd: '$(provisioningProfilePassword2)'
keychain: 'temp'
- task: InstallAppleProvisioningProfile@0
inputs:
provProfileSecureFile: 'AheMobilProd.mobileprovision'
removeProfile: true
- task: Xcode@5
inputs:
actions: 'clean'
configuration: 'Release'
sdk: 'iphoneos'
xcWorkspacePath: 'AheLine.xcworkspace'
scheme: 'AHELine.UI'
packageApp: true
signingOption: 'auto'
useXcpretty: false
args: '-verbose CODE_SIGNING_ALLOWED=No'
exportOptions: 'specify'
teamId: "Team Id"
exportTeamId: "Team Id"
- task: CopyFiles@2
displayName: Copy ipa file
inputs:
SourceFolder: 'output/$(SDK)/$(Configuration)'
Contents: '*.ipa'
TargetFolder: '$(System.ArtifactsDirectory)/ipa'
CleanTargetFolder: true
OverWrite: true
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'output/$(SDK)/$(Configuration)'
artifact: 'ipaRelease'
publishLocation: 'pipeline'
产生错误的重要部分:
- task: Xcode@5
inputs:
actions: 'clean'
configuration: 'Release'
sdk: 'iphoneos'
xcWorkspacePath: 'AheLine.xcworkspace'
scheme: 'AHELine.UI'
packageApp: true
signingOption: 'auto'
useXcpretty: false
args: '-verbose CODE_SIGNING_ALLOWED=No'
exportOptions: 'specify'
teamId: "Team Id"
exportTeamId: "Team Id"
这是我收到错误的输出:
CreateBuildDescription
Build description signature: 144ce6d56bd801279fb29aadcd9e17c3
Build description path: /Users/runner/Library/Developer/Xcode/DerivedData/AheLine-eocxsujbdezrsvhigklxsrkfkjlq/Build/Intermediates.noindex/ArchiveIntermediates/AHELine.UI/IntermediateBuildFilesPath/XCBuildData/144ce6d56bd801279fb29aadcd9e17c3.xcbuilddata
/Users/runner/work/1/s/AHELine.UI/AHELine.UI.xcodeproj: error: No profiles for 'com.ahe.aheline' were found:
Xcode couldn't find any iOS App Development provisioning profiles matching 'com.ahe.aheline'.
Automatic signing is disabled and unable to generate a profile.
To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'AHELine.UI' from project 'AHELine.UI')
** ARCHIVE FAILED **
##[error]Error: The process '/usr/bin/xcodebuild' failed with exit code 65
Finishing: Xcode
=> 安装Apple证书:https://gist.github.com/avatar-lavventura/64943138a05f5ca67afcd2d0361429df
=> 安装AppleProvisioningProfile:https://gist.github.com/avatar-lavventura/73f926e1e5c89d90504a57095193fe16
可能与:https://github.com/microsoft/azure-pipelines-tasks/issues/12263
在InstallAppleCertificate和InstallAppleProvisioningProfile这种情况下,您不能使用signingOption =“auto”,但您必须将signingOption =“manual”与特定的$(APPLE_CERTIFICATE_SIGNING_IDENTITY)$(APPLE_PROV_PROFILE_UUID)变量一起使用
-
task: Xcode@5
inputs:
actions: 'clean'
configuration: 'Release'
sdk: 'iphoneos'
xcWorkspacePath: 'AheLine.xcworkspace'
scheme: 'AHELine.UI'
packageApp: true
signingOption: 'manual'
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
useXcpretty: false
args: '-verbose CODE_SIGNING_ALLOWED=No'
exportOptions: 'specify'
teamId: "Team Id"
exportTeamId: "Team Id"