About a year ago (Nov 2016), Microsoft introduced a new application suite which was named Visual Studio Mobile Center. In November 2017, this solution was rebranded to Visual Studio App Center and made generally available. So, I think it’s about time we have a look at what App Center is, and what it can do for you!
Spoiler alert: it has everything to do with all your apps, and not just Xamarin apps!
I was actually attending the MVP Global summit in November 2016 when Microsoft introduced the Azure Mobile Center, which was what it was called back then.
I also remember slightly panicking when they demoed it. I was just starting off my first book which handles continuous integration and delivery for your Xamarin apps, based on Visual Studio Team Services (VSTS). For a second there I thought that App Center, as it is called today, would replace building apps in VSTS altogether and my book would become redundant instantly.
Luckily, that is not the case, but we will get to that a little later on.
Are you keeping up with new developer technologies? Advance your IT career with our Free Developer magazines covering C#, Patterns, .NET Core, MVC, Azure, Angular, React, and more. Subscribe to the DotNetCurry (DNC) Magazine for FREE and download all previous, current and upcoming editions.
What Is Visual Studio App Center? – A Brief History
App Center is a lot of things.
Microsoft calls it: “mission control for apps”, and that is exactly what it is. Almost everything that has to do with an app lifecycle, can be found in App Center.
As you might know, Microsoft has been acquiring some companies that are mobile related, as well as developing some mobile specific services, in-house. The most prominent one is of course Xamarin, which enables you to write cross-platform apps with all the .NET goodies. But HockeyApp, CodePush and Azure App Services are also on this list.
Let’s quickly go over each of them, so it gives you a better overview of what functionality came in App Center, and from where.
The HockeyApp solution was primarily targeting the distribution of apps outside of the regular App Stores. Its name was derived from the Ad-Hoc profile to distribute apps. By the means of HockeyApp, you were able to create groups of users, gather their device details and distribute a version of your app to this group, in a very easy manner. Later they also added some basic crash reporting and analytics, but before that ever really took off, Microsoft came in 2014 and bought the service as a whole.
When Microsoft made App Center generally available, HockeyApp became a free service to match the pricing of App Center. HockeyApp will be retired at some point, but it is unclear as to when that will exactly happen.
In early 2016, Microsoft and Xamarin announced that they have reached an agreement and Xamarin became part of Microsoft.
This is where things started to get interesting.
With the acquisition of Xamarin, they didn’t just gain a solution to build cross-platform apps, but also some great products and services like Test Cloud and Insights.
If you do not know it yet; Xamarin Test Cloud is a unique service which lets you run automated UI tests on actual physical devices. Running and testing your app has never been easier and in more resemblance to real world usage.
Xamarin Insights was another service that focused on retrieving crash reports and providing analytics, just like HockeyApp. However Xamarin did it a better job in my opinion. But that doesn’t really matter anymore right now because one of the first things that got merged was HockeyApp and Insights.
Actually, Xamarin Insights will be retired as of March 2018.
As an open-source project, CodePush has been around since 2015. This service focuses on releasing new code to an already released app, without the need to update. Basically, what this does is push a newer version of your app to users’ device, without going through the App Store review process.
This works for hybrid-based apps like React Native and Cordova and such. While this solution does have its purposes, it should be used sparingly. The App Stores will have strict rules in place when you want to update your app without going through their review process. Moreover, I can imagine that a user can be very confused when the whole app is just changed overnight, while they didn’t update anything themselves.
These services are now also integrated into App Center and will be retired as an individual service in October 2018. This functionality will not be described in detail in this article.
Visual Studio Team Services
What began as Team Foundation Server (TFS) has now evolved into a fully-featured, cloud hosted solution: Visual Studio Team Services. By using VSTS, you gain a lot of functionality at once: hosting code with Git, automated builds, automated releases, tracking work items and even more! This product (TFS) has been developed by Microsoft for over a decade now and is pretty sweet.
I already mentioned at the beginning of this article that you can setup a fully automated pipeline for your apps with VSTS, and you will be able to continue to do so.
In future, it should be possible to use some more advanced features of VSTS when starting from App Center, with just a click of a button. This is possible because VSTS APIs are used under the hood. That’s right, you’re just seeing another view on top of the VSTS powerhouse, especially for us mobile developers.
As you can see, Microsoft had a lot of awesome solutions at their disposal, some of which were overlapping. Basically, what they did is take the best of each of these services, rebrand them under one umbrella (Microsoft) and integrate them in a very effective way.
App Center is very focused on helping developers who are getting started with mobile development, as well as to make the life of an established mobile developer much, much easier. For instance: setting up a build takes you as little as 10 minutes! To see this in action, have a look at my Gur.Codes(); vlog here: https://www.youtube.com/watch?v=MDzyNSUvCOs.
App Center Today
Now that we have a pretty good understanding of what the App Center is, let’s just dive in and take a look at what we can work with today. To access App Center, just head over to https://appcenter.ms. There you have several options to create an account: GitHub, Microsoft Account, even Facebook and Google or just signup for a App Center account.
With whatever option you chose, you will land at your personal dashboard, mine is shown in Figure 1.
Figure 1: My App Center personal dashboard with the overview of my apps
The first thing you need to do is create a new app definition. You can do this by clicking the blue Add New app button in the upper-right corner.
To add an app, you will have to specify some basic information like name, the platform that you are targeting and the technology that it is built in. Note here that the technologies also list native technologies like Objective-C, Java and even Cordova! This means, you can also use it for any legacy apps that you might have lying around.
For this example, I will be sticking to a Xamarin iOS app.
After saving it, you will be presented with an app dashboard. Here you can find everything that is specific for this app. Because we have configured the targeted platform and also the technology for the app, it will already show some custom messages that are relevant to it. This also means that if you have one app that targets multiple platforms, each platform will have a separate app definition.
Looking at the welcoming page, we see that there are several NuGet packages available that we can drop into our project to enable crash reporting and analytics. More on that later on.
Let’s quickly go over the different sections that we see on the left (not shown in the figure), listing all the functionalities that we can use from within the App Center.
One of the main functionalities of App Center is the Build section. This enables you to setup an automated build pipeline within a matter of minutes, literally. If you have been into automated builds before, you might know that when building for iOS, you still need some form of Mac hardware!
Well, Microsoft has now taken care of this for you. They have provisioned Macs in the cloud, for you to use when building your app.
Want to hear something better? These can also be used in VSTS!
When we go into the Build section for the first time, we need to connect to a repository provider. It needs to get the code from somewhere. The providers supported right now are GitHub, Bitbucket and VSTS (with Git).
To connect, simply click the option of your choice and connect to that service. Once done, you will see all the branches currently in that repository. For each of these branches, you can create a separate build definition. To do so, simply click on that branch and a configuration screen will come up. The looks of this screen will depend a little bit on what platform you are targeting and which platform you are using, but the gist should be the same.
You can see the screen in Figure 2.
Figure 2: The screen where you configure the build for this branch
On the top of this screen, you will notice that the most important stuff is already filled in!
In case of my Xamarin iOS app, it already selected the solution to build, the configuration is set to Debug, and you can choose a Mono and Xcode version if you want to. But basically, you can leave it like this and just trigger a build immediately.
There are some options here for you to configure. Most notably, if you want to distribute your build, you need to sign it. Depending on the platform that you are targeting, you will need to provide some certificates or a keystore or similar. You can also incorporate Bash/Powershell build scripts to do some more advanced stuff and choose when a build should be triggered.
If you chose to sign your build, you can also enable the option to distribute this build - another great integration point; directly from build to release. Here you can define a group that you want to notify whenever there is a new build. Whenever that happens, these users can go into a web portal on their phone and download the new version right away.
There is one other option ‘Test on real device’, we’ll talk about that a bit more in a minute.
Test On a real device
This section is basically about Xamarin Test Cloud incorporated in App Center.
Here you will see an overview of the tests that you ran on this app. You can go into a certain test to run and inspect the results for all the devices that you specified. This proves to be a very powerful tool. Not only can you see a screenshot of every step along the way, but you will also be provided with data like device logs, stack traces (where applicable) and statistics like memory and CPU usage.
We won’t go into much details because I could write a separate article about it (and I did in an earlier edition of DNC Magazine), but I just what to show you how nicely this integrates with the automated builds.
If you recollect the steps in creating the build definition, there was a setting called ‘Test on real device’. With this little switch, you turn on a small sanity test. Without writing a single line of code, your app will be put through the Test Cloud on a physical device, just to see if it boots correctly, free of charge.
Pretty awesome, right?
The section under Distribute is mostly the part where HockeyApp comes in. This functionality enables you to configure certain users and organizes them into groups. From there, you can start distributing versions. These versions can either come from the App Center itself, or you can upload a binary. Another option would be to provide a binary from another build system through the App Center APIs.
The distribute functionality also helps you collect the device IDs which are required to be included in your test version of the app. It can even bring your app all the way to the actual App Store by integrating with the Apple and Google APIs for the same.
Another helpful feature is crash reporting. This is extremely easy to setup. To use the most basic functionality, all you need to do is drop in a NuGet package and use one line of initialization code. From then on, whenever your app crashes in an unhandled exception, the stack trace will automatically be reported here for you to see. This way, you can easily and quickly identify problems without having to rely on your users.
It also helps you categorize them and analyze the data to see if it happens on a specific OS version or version of your app, etc.
Although not available right now as of this writing, a future feature will give you the ability to report handled exceptions. That way you can get some more insights on errors that were handled in an orderly fashion, but might still be good to know of.
Analytics is somewhat related to crashes and like Crash Reporting, this is a mix of HockeyApp and Xamarin Insights functionality.
You can get some basic functionality by just dropping in the analytics NuGet package with just one line of initialization. This will help you identify where your users are using the app geographically, on what device, what version OS, what version of your app and much, much more.
You can also identify custom events, so you can track users as they go through your application. In Xamarin Insights, the analytics and crashes were very tight, and you could follow a user’s session right up to the crash, which can be very insightful.
Of course, be very careful with crashes and even more so, with analytics while collecting personal data the users’ permissions, as otherwise you might get into trouble with the new GDPR rules very easily.
Under the analytics section, there is a powerful little feature called Log Flow. When you go to it, you will be presented with an empty screen and a message telling you that it is waiting for data from your app. Then when you start your app with the analytics package installed, you will start seeing near real-time data flowing in from your app session.
If you think about mobile, you can’t get around push notifications. There are some services within Azure that help you with this, but of course App Center is the perfect place for this.
Incorporating push notifications can be done easily with a NuGet package, although it needs a bit more work than the crash and analytics one. When implemented, App Center lets you build different audiences easily. Besides sending notifications to everyone, you can also send something to a subset based on geographic location, version of the app, OS version and more.
At this point, it is probably also good to mention that App Center offers a lot of great services, but it is up to you which services you want to use and how. You can mix-and-match all the services to accommodate for your needs. This way, it is very easy to transition gradually into App Center for instance.
App Center is built API-first, which means that the APIs are actually a bit ahead of the UI in terms of features. To make it even more easier to reach these APIs, Microsoft has also introduced a command-line interface tool. With this tool you can easily integrate calls to the App Center APIs from your existing build pipeline.
You can see the full API definition here: https://openapi.appcenter.ms/ and the command-line tooling can be found here: https://github.com/Microsoft/appcenter-cli.
Another important aspect that you might be interested in is the pricing of all this goodness. While everything was in preview, it was free of charge. At the time of writing, some parts are still in preview and thus for free, but you can expect this to change.
The pricing right now can be seen in Figure 3 and is designed to increase, as your app grows.
Figure 3: Pricing for the different functionalities of App Center
As mentioned, you can start for free with building (limited to 240 build minutes per month), distributing (unlimited releases to unlimited users), crash reporting and analytics.
For the automated UI tests, a 30-day trial is available.
So, as you can see, there is nothing stopping you from trying it out right now!
Let’s Sum It All Up
Visual Studio App Center proves to be a great tool for everything that has to do with your mobile app development. You can start with the basic functionalities for free, so there should be no reason to do any more ‘right-click deploys’.
Now go and set up that automated build and distribution pipeline. It’s a breeze!
There are some rough edges right now in terms of missing functionalities that was available earlier as separate services (e.g. HockeyApp of Xamarin Insights), but these will be brought back eventually.
It is awesome that all the tools are available through APIs and command-line tools, this way you can incorporate it in a variety of ways and start working with it, whichever way you like.
Nevertheless, the App Center has a great looking UI too which can help you get started in no time.
All in all, App Center is a great product to keep your eye on, I think there is a lot more to come. For now, all the tight integrations with Azure seem to be put on the backlog, but I’m sure it will return eventually.
To stay informed about the future plans, have a look at the road map: https://docs.microsoft.com/en-us/appcenter/general/roadmap.
If you have any questions, please don’t hesitate to reach out to me in any way. Thank you for reading!
This article was technically reviewed by Suprotim Agarwal.
C# and .NET have been around for a very long time, but their constant growth means there’s always more to learn.
We at DotNetCurry are very excited to announce the The Absolutely Awesome Book on C# and .NET. This is a 500 pages concise technical eBook available in PDF, ePub (iPad), and Mobi (Kindle).
Organized around concepts, this eBook aims to provide a concise, yet solid foundation in C# and .NET, covering C# 6.0, C# 7.0 and .NET Core. Use these concepts to deepen your existing knowledge of C# and .NET, to learn new features or to crack your next .NET Interview.
Click here to Purchase this eBook at a Discounted Price!