Mobile Build Services
Analytics and Diagnostics
The course is part of this learning path
This course dives into creating a DevOps strategy for mobile applications using the Visual Studio App Center. The App Center gives us a centralized location where we can implement build services, carry out mobile UI testing with multiple devices sets, create public and private distribution groups, and perform release management for our distribution groups.
Build services include tvOS, iOS, Android, Xamarin, and more. UI testing includes UI testing across many popular flagship devices and uses a tier system to gradually cycle out older devices as newer ones become available. Distribution groups allow for deploying new releases to multiple types of users and can be utilized across multiple applications or projects. This course explains many of the options and services available in the App Center and provides guided demonstrations with a mobile app to show how each of these available services works.
By the end of this course, you should know how to utilize App Center to implement a DevOps strategy for integrating and deploying a mobile application. If you have any feedback relating to this course, please contact us at email@example.com.
- Create an App Center account and build a new application
- Perform UI tests in both the App Center CLI and Azure DevOps pipeline
- Create public and private distribution groups and release apps to them
- Understand and use the analytics and diagnostics provided by App Center
This course is intended for DevOps and IT professionals who are looking to implement a DevOps strategy for mobile applications using Visual Studio App Center to build, test, distribute, and deploy their mobile applications. This course is also useful for those preparing to take Microsoft's AZ-400 exam.
To get the most out of this course, you should know how to build and upload mobile applications if you are not using the build tools provided by the App Center. You should know how to work with Node package manager and have NPM installed or know how to install it. You should also be fairly comfortable with using command-line interface tools.
You can find the project files for a sample mobile application in the following GitHub repository: https://github.com/kelsosharp/MobileDevOps
In this demonstration, we'll be diving into App Center build services. App Center can handle building mobile applications, testing UI on physical devices, managing distribution groups, crash reporting, and usage monitoring.
The first thing that we need to do is point our browsers to appcenter.ms. This will take us to the main sign up page for App Center. We will just click the "GET STARTED" button in the top right. This link will take us to the create account page. Here we have the option to use third-party authentication from GitHub, Microsoft, Facebook and Google. We can also create an App Center account directly. I'm just gonna use my GitHub account because that will make it simple to connect to our code repository on GitHub.
Once we have signed into our account, the first thing we might wanna do is to set up an organization. Organizations in App Center are just a convenient way to organize our applications, especially if we're working with multiple teams and multiple applications. Attaching an Azure subscription to this organization will allow you to integrate it with tools like Azure Key Vault and Active Directory from that subscription.
Now we can click the "New App" button in the top right. That will bring up our new application configuration page. Here we can enter our application name, and note this did not need to be the same as our project name. We then pick an operating system and a platform and finally click the "Add new app" button to create our application. I'm not gonna add this app since I've already created one for us to use in this demo.
If you'd like to clone the mobile application to follow along with this demo, you can find it at the following URL. This application is just a template Xamarin drawer style Android application, with a Xamarin UI Test project for the UI testing. We will need this later to integrate our tests with the App Center Testing API.
The main overview page should now be displayed. This page explains how to configure App Center to work with your particular development environment and IDE setup. We're using straight Xamarin on a Windows 10 client machine, which means we will need to have the Xamarin SDK installed at a minimum.
Now let's have a look at how to connect our code repository to our new App Center application. We will just click on the build option from the menu on the left-hand side, that will give us a list of code repository providers and currently App Center only supports Azure DevOps, GitHub, Bitbucket and GitLab. Our code is currently in GitHub so that's what I will select.
Now we see a list of repositories on our GitHub account. I will select the MobileDevOps project and that's all we need to do to link our App Center account to our code repository. If you did not use GitHub as your credentials provider, you will most likely need to authenticate with whichever provider you use and provide access for App Center to your repository.
Since I've already committed the master branch to my code repo and it is ready to build, we can now configure our build settings for this branch. When we click it we can see that there's now a "Configure build" button on our last commit. I will go ahead and click it so we can configure the App Center build options.
This is our build configuration page. Here we can set the type of build we want, debug or release. We can set the version of the Xamarin SDK used to build our application, we can specify any build scripts we might wanna use, and set our build frequency. This is what triggers our builds. Some of the other options are Build Android App Bundle, this creates a bundle as well as your APK file if checked. We can turn on auto-increment for updating our app version automatically, we can set environment variables. If you're going to use App Center to deploy your application, this is where you would provide your KeyStore or provisioning profile for Android and Apple. This will allow App Center to sign our builds for deployment to the app stores and enable physical device testing.
At this point, we can set our build to do an initial test on an actual device, but in order to do that, we need to change a project property in our Android project. "Use a shared Runtime" needs to be unchecked. Let me show you how to do that in Visual Studio.
The first thing we need to do is to right-click on our main Android project and select the project properties page. On the properties page, we need to click on the "Android Options" section and then uncheck the "Use Shared Runtime" option. This is usually checked by default and I previously unchecked it when I created this project for use in our course.
Now that we have our build configuration set up, let's run our build. This is gonna take a few minutes, so while that's building, let's talk about the costs for App Center Services. The free tier of App Center gives you 240 build minutes per month, with a single build time limit of 30 minutes. You get a 30-day free trial of UI testing on real devices to start with, unlimited distributions and unlimited users, and full access to analytics and crash reporting.
If the free tier is no longer meeting your needs, for example, if you have multiple teams building multiple applications in App Center at the same time, without concurrent builds, they will simply be queued and execute in sequence. You can add additional concurrent builds for an extra $40 per month for each additional build. This is referred to as build concurrency. This is defined by Microsoft as "the number of builds that can run in parallel "at any given time."
For UI testing this is a similar pricing model. After your 30-day trial is over, testing costs $99 per month for 30 hours of device time per device concurrency. For example, if you have five devices, the devices will be tested in sequence up to 30 hours in a month. If you were to purchase five concurrent devices, then all five devices would be tested at the same time and reduce your overall testing time to one fifth, and you have 150 total device hours to work with.
Now that our build is done, we can see that it's been successful. So as you can see there's plenty of options in the build services for App Center. In our next module, we'll be talking about how we go about testing our mobile applications on real devices. I hope I see you there.
As well being the owner and CTO of Sharp Solutions Group, a software development and IT staffing company based in the Philippines, Kelso is a Microsoft Certified professional and an avid knowledge seeker. His belief is that you need to learn something new each day to stay on top of the constantly changing IT world. He is an avid gamer (both video games and board games) and lives in the Philippines with his wife and soon-to-be-delivered son.