MacinCloud Visual Studio Team Services Build and Improvements to iOS Build Support
Visual Studio Team Services (formerly Visual Studio Online) and Team Foundation Services 2015 supports a cross-platform build system that allows you to quickly and easily configure builds that run on Windows, Linux, and even OSX. All Visual Studio Team Services accounts come with a free Windows based hosted build agent but Xcode / iOS builds have not had a cloud hosted option. This can be problematic for organizations that would prefer not to manage Macs in their datacenters or for smaller organizations that would prefer not to maintain dedicated Mac hardware for CI.
To resolve this challenge, we’ve partnered with MacinCloud to introduce a VS Team Services / VSO build agent plan. Setup is streamlined and MacinCloud servers come pre-installed with the software you need to get up and running in as few steps as possible. The plan is currently in preview $30/mo per agent with no limits on build hours. While you’ll still need to sign up for the Apple Developer Program to obtain signing certificates and provisioning profiles necessary to build and release your app, a MacinCloud agent can even be used with the free tier of VS Team Services as you are provided one complementary “private” agent slot.
In this blog post we’ll cover how easy it is for you to add a MacinCloud agent to a VS Team Services account and highlight a number of other improvements we’ve made to better support building projects on Macs.
5 Steps to Mac Based Cloud Build Support in VS Team Services
There are just 5 easy steps to get yourself up and running with Mac based builds in VS Team Services.
- Sign up for VS Team Services – You can even use MacinCloud with the free tier of VSO!
- Sign up for MacinCloud’s VS Team Services / VSO plan and you’ll get access to the VSO/VS Team Services Agent feature in the MacinCloud portal. (For questions, please contact email@example.com).
- Next, add your user to the Agent Pool Administrators and Agent Pool Service Accounts groups in VS Team Services.
- Go to Account Admin (gear upper right) > Control Panel > Agent Pools tab > All pools
- Add your user to Agent Pool Administrators and Agent Pool Service Accounts groups
- Create an “Access Token” for the agent in VS Team Services
- In VS Team Services, click on your user name in the upper right hand corner > My Profile
- Now go to Security > Personal Access Tokens > Add
- Give it a name, set the timeout to 1 yr, select All Scopes, and grab the token
- In the MacinCloud Portal, setup your agent!
- Click on Developer > VSO Agent (Preview) and click the edit button on one of the unused agent slots in the list
- Enter your VSO domain (https://mydomain.visualstudion.com), the access token you created in step 1, and give it a unique name for your VSO instance and click Save.
- You can also use this same screen later to upload any number of certificate and provisioning if needed. However, we’ve got some features that should allow you to skip this step completely for Xcode and Cordova projects!
Important Note: You are provided one complementary “private” agent slot in your VS Team Services / VSO instance for free. This includes any MacinCloud agent. However, the free tier also gives you access to a Hosted Windows agent as well (for a total of 2) and you can purchase additional private slots as needed.
Create a Build Definition for Your Project
Now that you’re up and running, use VS Team Services to create a build definition for your project!
Xcode & React Native Projects
All VS Team Services instances now have an updated Xcode Build step that provides additional options including the ability to simply reference a certificate and mobile provisioning file in your repository and have the VSO agent handle installing and managing certificates for you. Certs are then managed local to the project to take the guesswork out of certificate management. Perfect for MacinCloud!
Setting up the Xcode Build step is pretty self-explanatory, but you can check out the detailed tutorial to see how you can use it to test and publish test results to VS Team Services using xctool and even run tests in MacinCloud with Xcode 7 or up. In addition, if you are new to managing signing and provisioning in a CI environment, we also have a cert management tutorial that can fill you in on the details.
React Native projects can also use this same build step and we’re working to improve setup further. See this blog post for information on current setup steps.
A new VS Team Services / VSO extension makes setting up Cordova projects in a CI environment simple. It includes the same cert management features as Xcode Build, caches multiple versions of Cordova for improved performance, and more. These tasks should work with any Cordova CLI compliant project including those created in Tools for Apache Cordova or command line tools like Ionic.
Simply install the VS Team Services Cordova Extension and use the included Cordova or Ionic steps. The build steps are easy to configure, but check out the detailed tutorial for full setup details including using Karma to test your apps.
Xamarin iOS Projects
Currently Xamarin iOS projects require a manual activation of your Xamarin license in MacinCloud and you’ll need to add signing certificates to MacinCloud’s servers through their portal. Follow Xamarin’s Offline Activation steps and work with Xamarin and MacinCloud support to complete your activation. In the near future you’ll be able to use the Xamarin License build step to activate your license and take advantage of the same signing features available for Xcode and Cordova today.
You are no longer required to manually activate your Xamarin license. Please see https://www.visualstudio.com/en-us/docs/build/apps/mobile/xamarin for the latest documentation.
We’re committed to making building Xcode and iOS projects in a CI environment easier than ever before with our cloud and on-premises solutions. We hope that you find these improvements and MacinCloud’s great new offering useful. We’re always interested in your feedback on how we can make things even better, so please contact us via UserVoice with your ideas and suggestions! You can also connect with MacinCloud via email or Twitter with any questions, issues, or suggestions you may have for their exciting new offering.