Edward Brey
Edward Brey

Reputation: 41638

Visual Studio for Mac as VSTS build agent for iOS?

Visual Studio is the recommended tool (superseding Xamarin Studio) on both Windows and Mac. However, the VSTS page Build your Xamarin app says to use "Xamarin". Presumably that means Xamarin Studio, even though the the "Install Xamarin" link on the page points to Visual Studio. That ambiguity and the March 6 date on the page indicate that it was overlooked during the rollout of Visual Studio 7 for Mac, leaving us to wonder what is the right approach for setting up an agent.

What is the best way to create an iOS build agent these days? Do you install Visual Studio for Mac or Xamarin Studio?

Upvotes: 1

Views: 536

Answers (2)

Tom Opgenorth
Tom Opgenorth

Reputation: 1511

Sounds like a bit of confusion here in the terminology. The IDE is now Visual Studio for Mac, but the underlying framework is still Xamarin. That is to say, Xamarin.iOS/Xamarin.Android/Xamarin Forms are "integrated" into Visual Studio for Mac; they are the tools that will compile and package your mobile app. This is what the VSTS build task page is saying when it asks you to "Install Xamarin".

As for setting up a VSTS build agent, here's a checklist that will hopefully get you going:

  1. Download and install Visual Studio for Mac on a computer running OS X/macOS. Confirm that Visual Studio for Mac can indeed build and sign the IPA's.
  2. If necessary, install all the certificates and provisioning profiles, and confirm that the IPA is correctly signed.
  3. Create a build project in VSTS.
  4. Install the VSTS build agent for OS X/macOS and connect/register the build agent to the VSTS project. Please be aware that the Xamarin license task/utility is deprecated and no longer needed. If that does appear as a step in your VSTS build project, delete it.
  5. Go back to VSTS, and configure the VSTS project to build the Xamarin.iOS project via the OSX/macOS build agent. Once the build agent is connected to the VSTS project.

I'll admit, there is a lot of moving parts and things to do here. I hope this high level overview is enough to point you in the right direction.

Upvotes: 2

Edward Brey
Edward Brey

Reputation: 41638

Per starain's advice, I tried installing VS for Mac. It started up, but failed with an 'Unable to parse condition "!(Exists($(SharedVersionOutputDirectory)))"' error. I've encountered several bugs in the Xamarin tool chain, so this may have nothing to do with VS vs. XS, but just be part of the current duct-tape-and-bailing-twine experience. OTOH, there's still a top-level Xamarin page saying VS Mac is still preview, so who knows how baked it really is?

So even though the Mac build agent does find and run the VS Mac build tooling, I gave up and used my Windows build agent instead, and had MSBuild on Windows connect to the Mac for the iOS build.

Upvotes: 1

Related Questions