问题描述: 在Xcode 12堆栈中,Bitrise可以正常工作,并与证书/配置文件配合使用。但在Xcode 11.7中,Bitrise没有工作。需要提供解决方法,包含代码示例。
解决方法: 在处理此问题之前,请确保您在Bitrise上正确配置了证书和配置文件,并且已将它们添加到工作流中。
一种可能的解决方法是在Bitrise工作流中手动指定使用的Xcode版本,而不是依赖Bitrise默认的版本。这样可以确保在不同的Xcode版本中都能正常工作。
以下是一个示例工作流,其中手动指定了Xcode版本:
---
format_version: "6"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
workflows:
main:
steps:
- activate-ssh-key@4.0.3:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@4.0.17: {}
- cache-pull@2.1.2: {}
- certificate-and-profile-installer@1.10.2:
inputs:
- certificate_url: "$CERTIFICATE_URL"
certificate_password: "$CERTIFICATE_PASSWORD"
profile_content: "$PROFILE_CONTENT"
- script@1.1.5:
inputs:
- content: |-
#!/bin/bash
set -ex
# Install a specific version of Xcode
# You can find the available versions here: https://releases.bitrise.io
XCODE_VERSION="11.7"
sudo xcode-select --switch /Applications/Xcode_${XCODE_VERSION}.app
# Run your Xcode commands here
- cache-push@2.3.0: {}
在上面的示例中,我们在script
步骤中使用sudo xcode-select --switch
命令手动指定了要使用的Xcode版本(11.7)。您可以根据自己的需求修改此版本号。
您可以在script
步骤中执行您需要的任何Xcode命令,例如构建、测试等。
请注意,如果您使用了其他Bitrise步骤,您可能需要根据您的项目配置进行适当的更改。
希望以上解决方法能够帮助您在Xcode 11.7中使Bitrise正常工作。