I use an CmdLine@2 task in my azure DevOps pipeline and trying to build the app, but unfortunately the Xcode Build job failed. I'm using SwiftUI classes which need to be at least build with Xcode 12.5, but the azure DevOps agent uses Xcode 12.4 version which causes the failure. How can I still using the CmdLine@2 task, determine the Xcode version?
Here is the code of the .yml:
- task: CmdLine@2
displayName: 'Xcode Build'
inputs:
script: |
echo "Build iOS app"
cd $(Build.SourcesDirectory)
/usr/bin/xcodebuild -workspace '$(workspace)' -scheme '$(schemeName)' build -allowProvisioningUpdates CODE_SIGN_STYLE=Manual DEVELOPMENT_TEAM='$(developmentTeam)' CODE_SIGN_IDENTITY='$(signingIdentity)' APP_PROFILE='$(***Profile)' EXTENSION_PROFILE_FW='$(***FavWidProvProfile)' EXTENSION_PROFILE_NCW='$(***NCWidProvProfile)'
I'm using the CmdLine task, because the current version of the Xcode@5 task has limitations to build the application with multiple App extensions.
CodePudding user response:
Depending on the agent that you are using check it's README to see where each Xcode version is located, for example macos-11
Then use xcode-select
to select the version you want before building
Example:
sudo xcode-select -s /Applications/Xcode_12.5.1.app