lawiluk
lawiluk

Reputation: 597

How to used Xcode task in Azure Pipelines?

I have a Xamarin CI process set up in Azure Pipelines. Due to my recent changes, I need to use iOS 13.0 to compile my code.

In my azure-pipelines.yml I have the following code:

   - task: Xcode@5
     inputs:
      sdk: "iphoneos13.1"
      xcodeVersion: "/Applications/Xcode_11.1.app"
      actions: 'build' 

Sidenote: I am using poolvmImage: 'macos-latest'

I took the Xcode task from this documentation.

On GitHub it looks like ALL Mac machines have iOS 13 SDK installed.

...but when I run

- task: CmdLine@2
     inputs:
      script: 'xcodebuild -showsdks'

from my yml file it is displaying the following output:

Script contents:
xcodebuild -showsdks
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /Users/vsts/agent/2.158.0/work/_temp/11b07ed3-faf4-4917-a9ea-3c1dc52aa96f.sh
iOS SDKs:
    iOS 12.4                        -sdk iphoneos12.4

iOS Simulator SDKs:
    Simulator - iOS 12.4            -sdk iphonesimulator12.4

macOS SDKs:
    macOS 10.14                     -sdk macosx10.14

tvOS SDKs:
    tvOS 12.4                       -sdk appletvos12.4

tvOS Simulator SDKs:
    Simulator - tvOS 12.4           -sdk appletvsimulator12.4

watchOS SDKs:
    watchOS 5.3                     -sdk watchos5.3

watchOS Simulator SDKs:
    Simulator - watchOS 5.3         -sdk watchsimulator5.3

The question is: how to force Azure Pipelines to use iOS 13 and Xcode 11 to build my app?

Upvotes: 1

Views: 1293

Answers (1)

Mengdi Liang
Mengdi Liang

Reputation: 18958

The issue you are facing should be due to our image deployment delays. For my region(East US 2),if I execute the command

xcodebuild -showsdks
xcodebuild -version

And below is the iOS and Xcode info about the Hosted macOS 10.14 on my region.

enter image description here

According to the info you shared, seems the hosted agent used by the region where your org is located have not been deployed with these latest upgrade. So, even with command to pick up iOS 13 or other SDK still could not succeed because of none SDK exists.

Most time, the deployment process would has some delay because of different regions. Please pay some times to waiting for the deployment job finished. It will be fully deployed to all regions in the latest two weeks.

If you are hurry for building and deploy your app with these SDKs, here has a temporary work around can for you use: install the private macOS pre-release agent by reference to this link: Pre-release agent 2.159.1.

Upvotes: 2

Related Questions