gpt4 book ai didi

ios - 无法加载证书,Xcode 构建无法安装证书(VSTS/Azure DevOps、YAML 管道)

转载 作者:行者123 更新时间:2023-11-28 23:46:18 27 4
gpt4 key购买 nike

我在 Azure DevOps 中使用 YAML 管道来构建 iOS 应用。

我的 YAML 如下所示:

# Xcode
# Build, test, and archive an Xcode workspace on macOS.
# Add steps that install certificates, test, sign, and distribute the app, save build artifacts, and more:
# https://learn.microsoft.com/vsts/pipelines/languages/xcode

pool:
vmImage: 'macOS 10.13'

steps:
- task: InstallAppleCertificate@2
displayName: 'Install an Apple certificate'
inputs:
certSecureFile: 'FILE_ID'
certPwd: '$(P12password)'

- task: InstallAppleProvisioningProfile@1
displayName: 'Install an Apple provisioning profile'
inputs:
provProfileSecureFile: 'FILE_ID'

- task: CocoaPods@0
displayName: 'pod install using the CocoaPods task with defaults'

- task: Xcode@5
displayName: 'Xcode build'
inputs:
xcWorkspacePath: 'MyApp.xcworkspace'
scheme: 'MyApp'
xcodeVersion: 'Default'
signingOption: manual
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'

我在安装 Apple 证书的步骤中遇到错误:

2018-10-02T20:08:23.4496940Z ##[section]Starting: Install an Apple certificate
2018-10-02T20:08:23.4786520Z ==============================================================================
2018-10-02T20:08:23.4786680Z Task : Install Apple Certificate
2018-10-02T20:08:23.4786800Z Description : Install an Apple certificate required to build on a macOS agent
2018-10-02T20:08:23.4786940Z Version : 2.137.0
2018-10-02T20:08:23.4787050Z Author : Microsoft Corporation
2018-10-02T20:08:23.4787160Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=862067)
2018-10-02T20:08:23.4787280Z ==============================================================================
2018-10-02T20:08:24.9657760Z [command]/usr/local/bin/openssl pkcs12 -in /Users/vsts/agent/2.140.2/work/_temp/PWEKQ6YCZA.p12 -nokeys -passin pass:*** | /usr/local/bin/openssl x509 -noout -fingerprint
2018-10-02T20:08:25.0196330Z 140735606010824:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1220:
2018-10-02T20:08:25.0197000Z 140735606010824:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:386:Type=PKCS12
2018-10-02T20:08:25.0332040Z unable to load certificate
2018-10-02T20:08:25.0332600Z 140735606010824:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:697:Expecting: TRUSTED CERTIFICATE
2018-10-02T20:08:25.0437120Z ##[error]Error: /usr/local/bin/openssl failed with return code: 1
2018-10-02T20:08:25.0514080Z ##[section]Finishing: Install an Apple certificate

知道这里可能出了什么问题吗?

我还尝试通过 UI 在 Azure DevOps 中设置构建管道,但我得到了相同的结果。

最佳答案

您似乎一直在关注this guide就像我一样。

问题似乎出在读取 $(P12password) 变量上。我尝试直接在 Install Apple Certificate 任务中输入证书密码而不使用变量,它通过了。

希望我们能够共同改进这个答案,使其成为一个“解决方案”,而不仅仅是一个解决方法。

关于ios - 无法加载证书,Xcode 构建无法安装证书(VSTS/Azure DevOps、YAML 管道),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52615781/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com