When I joined Xamarin in December of 2013, it was still largely a one product company. Xamarin enabled you to develop apps for Android, iOS, or Mac using C#. (OK, technically three products but to a degree you can look at them as different facets of the same tool).
Since that point Xamarin has grown to help assist in the full mobile development lifecycle. This included the launch of Xamarin University for training, Xamarin Test Cloud for better testing and Xamarin Inisghts for crash reporting, messaging and analytics. With Xamarin now under the Microsoft umbrella, a few new tools are available to even further complete that picture. The focus of this entry will be on how to leverage Visual Studio Team Services with Xamarin, both development and Xamarin Test Cloud, to create a full Dev-Test-Publish lifecycle.
Getting setup with Visual Studio Team Services
I won't spend a whole lot of time on this. The basic checklist can be found below.
1. Create your VSTS account
2. Create your Project
3. Connect to Visual Studio
4. Set up your repo and code
The main setup guide hub can be found here: https://www.visualstudio.com/get-started/setup/set-up-vs
For my scenario, I ended up using git as my repository, which would also be my recommendation if you don't have a previous requirement or preference.
Integrating Xamarin Test Cloud
Now that you have your code integrated with VSTS, and uploaded, the next step is to create a build process that confirms your build and also calls to Xamarin Test Cloud for regression testing. That way, any time a developer on your team submits their code, you can confirm everything is still working. Please note, this will require having created a UITest project and at least one step to run. If you have not ever done this, you can find more details here:
Now, the final piece of this puzzle is to integrate this as part of your VSTS build chain. Microsoft actually made this process quite straight forward, once I had my head wrapped around the tooling. A full general doc, found after I got it sorted myself, can be found here:
This is what I wanted to break down and guide in more detail. First, select the Build tab in the VSTS portal and hit the green "+" button:
|So many options|
But it can be boiled down to
1. Your license login (user name and password) information to activate\deactivate your Xamarin credentials
2. Xamarin Test Cloud API Key, Device ID, Test Cloud email
As a pro-tip for the password, the password field defaults to a plain text entry. What I would recommend is select the variables tab, and add your password as a variable, with the lock icon selected to flag it as "Secret".
|MyPassword is the variable I have created.|
For the "Test" step, you need to provide a few pieces of information.
First is your Test Cloud API Key, which is found under Teams and Organizations on your Test Cloud account. You can find details on obtaining that here: https://developer.xamarin.com/guides/testcloud/organizations-and-teams/#Obtaining_the_Team_API_Key
If you are not currently using Xamarin Test Cloud, fear not! We have a free trial that you can try out. More details can be found here: https://testcloud.xamarin.com/register
Again, you need to provide an email, this time the email of registered/added to the Test Cloud account. This may or may not differ from your Xamarin license details.
The devices ID you can acquire when you create an upload on Xamarin Test Cloud. The final step will give you a command line prompt that can be used for Windows or OSX and included is a --devices (#########) flag. This id is the final piece of information as it tells Test Cloud what devices the test needs to be run on, and can be reused from run to run. I would recommend recording these ID's as currently there is not another way to retrieve them to my knowledge.
Once you have entered all this information you have everything you need. At this point I would recommend selecting "Queue build" to do a test run with what you have uploaded, troubleshoot issues as needed. Ideally you should see this:
|Green is good!|