Azure DevOps is the ideal partner for automating builds and releases of our Xamarin iOS applications. When creating an iOS build, a good practice is to specify which version of Xcode it should target. Otherwise if the agent is updated with new versions of Xcode the build may be altered.
The problem is that there is no dedicated task for selecting the Xcode version.
So we are going to create a dedicated Bash task ourselves. From the definition of your build: click Add Tasks, then select a Bash task.
Original illustration unavailable
Once the task is created, you must: Give him one Display name – Select the type: Inline
Original illustration unavailable
And finally add the following code to the script field:
#!/bin/bash
/bin/bash -c "echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_10.1.app;sudo xcode-select --switch /Applications/Xcode_10.1.app/Contents/Developer"
If you're interested in other tricks for iOS I'd recommend this very good article.
Happy coding 🙂