Introducing Boots: Streamline Xamarin Continuous Integration

Avatar

Jonathan

Many Xamarin developers take advantage of Azure DevOps or Visual Studio App Center to build and release their mobile applications. Each environment has its own installation of Mono, Xamarin, and everything you would need to build your Xamarin project.

However, each offering has some drawbacks:

  • Azure DevOps currently has a single, fixed installation of Mono and Xamarin.
  • App Center has a dropdown for selecting a specific version of Xamarin, but not always the latest release.

In both cases, developers will have to wait for updates to make it Azure DevOps or App Center. The latest Xamarin builds don’t currently arrive the same day as they are on the Visual Studio release channels, and there is not a way to install preview builds of Xamarin.

Introducing Boots

Boots Icon PNG for blogInternally we use a tool that can install specific builds of Mono, Xamarin, etc. on CI systems. It has been extremely valuable to pin builds to a specific version of Mono, Xamarin.Android, and Xamarin.iOS. We wanted all Xamarin developers to be able to do this, and so Boots was born.

Boots is a .NET Global Tool for installing .vsix or .pkg files. To use it:

Boots currently supports Windows & Mac OSX, therefore:

  • On Windows – assumes the file is a .vsix and installs it into all instances of Visual Studio via VSIXInstaller.exe.
  • On Mac OSX – assumes the file is a .pkg and installs it

So for example, to install Mono, Xamarin.Android, and Xamarin.iOS on Mac OSX:

Or install Xamarin.Android on Windows:

Unfortunately, finding URLs for each of these builds is in a different place for each product.

URLs sourced from:

Azure DevOps

On Azure DevOps, simply add this YAML to your existing build definition:

DOTNET_SKIP_FIRST_TIME_EXPERIENCE is optional, but will speed up the first dotnet command.

To make things even simpler, we’ve published a Boots Extension from the VS Marketplace. This makes it easy to use from the build definition UI as well as from YAML:

App Center

App Center currently has an option to run a script during different points in your app’s build process. For example, placing a appcenter-post-clone.sh in the same directory as your project can install a newer Mono and Xamarin.Android than currently available:

See the App Center docs for further detail about custom build scripts.

Boots with Cake

You can use Boots from a Cake script:

This will be helpful if you are already using Cake, and it gives you the flexibility to write custom build logic in C#!

Other CI Systems

Boots has been tested, and appears to work fine on:

Any build environment that can be configured to run .NET Core 2.1, can run Boots . If you have success on other CI systems, let us know!

Avatar
Jonathan Peppers

Senior Software Engineer, Xamarin.Android

Follow Jonathan   

2 Comments
Avatar
Mason Chen 2019-08-15 21:33:53
I am trying to use this tool on Azure DevOps. But when I added it to my build definition, it seems like it is running forever on the install Xamarin.Android task. I am wondering how long does it normally take to get the installation done on Azure DevOps? Thanks in advance.