During a current project we needed to evaluate possibilities to easily set up a Continuous Integration and Deployment system. For several reasons we normally would suggest an In-House solution with TeamCity, but the customer preferred a cloud solution to shorten the procurement and installation process. In this post I explain why and how we set up Bitrise.
Unfortunatly Bitrise removed support for Xamarin projects by the end of 2021. While existing workflows stil contains the now depricated build steps, the required infrastructur behind is not available anymore. Read more about the reasons behind the decision to end support at the bitrise blog and how you can stil use bitrise to build Xamarin apps.
To the normal requirements for a CI and CD process we added the following additional requirements:
Bitrise main focus is on mobile app development with out of the box support for Xamarin to an affordable price. For Indy and hobby developer or very small teams is a free tier available that is limited to a single concurrency. This means that your team can set up multiple workflows to build and deploy your mobile app, but only one can run at a given time. If there is a need to run multiple workflows at the same time an upgrade to the pro version is necessary.
Beside the fair pricing Bitrise also comes along with a huge list of extensions that are very easy to integrate into an existing or new workflow.
After signing up at bitrise.io you will find yourself at the quick-start guide where you can choose to set up a new app or start with a sample app. In this post we start with a new app to demonstrate how easy it is to set up a workflow with Bitrise.
Following basic steps need to be done:
The first step is to choose where the sources can be accessed by Bitrise. In our case it is Bitbucket. With a single click it authenticates and integrates Bitbucket into your Bitrise account. Furthermore, we need to select a repository we want to build with this workflow. Bitrise will then run a validation task in which it clones the repository and try to detect the type of project it is. In our case it identified our repository as a Xamarin project and pre-selected that configuration for us.
After the initial repository configuration is done, we are ask to select and confirm the build configuration we want to work with. At the moment we also can set up our Xamarin account information. This step can be skipped. I expect that this step isn't necessary any more in a near future, now that Xamarin is open source.
To notify Bitrise that there are changes in our repository, we need to set up a webhook that will automatically be executed on every push to the selected branch. For Bitbucket and GitHub as well as for Visual Studio Online Bitrise is able to add this type of webhook if administrative rights are applied to the connected account.
Everything is now set up for the first run. Time to hit Start a build and if all is set up correctly you should see a success entry. This is the easiest way of setting up a Continuous Integration and Deployment system in less than an hour.
The basic workflow we set up suits our need to build our project. Now it is time to extend it to with other services like HockeyApp, NUnit runner or Xamarin Test Cloud to name a few.
On the apps dashboard select Workflow. This brings up the current workflow we configured early through the guide. Additional changes can be made through the Manage Workflows button in the top right corner which start the Workflow editor.
Each step is now editable and can be moved with drag and drop. Additional steps can be added with the plus sign.
To add Xamarin.Insights to the current workflow hit the plus sign after the Xamarin builder step. In the Add Step dialog select Xamarin.Insights and click Add to Workflow.
Xamarin.Insights is now added to the workflow and can be configured through the form on the right sight of the Workflow editor. Very easy.
We experimented a lot to streamline our development process to make it smooth and fast while easy to maintain. I want to share some steps that proved worth to add to make the integration and deployment process as autonomous as possible:
Bitrise is a mature alternative for setting up a self-hosted CI and CD process that is worth to evaluate. The huge extensibility with custom and predefined build steps makes it easy to use at a minimum of maintenance efforts. We at Cayas will recommend it to customers who are looking for exactly that.
Ich bin Mobile-Enthusiast mit großer Begeisterung für die Entwicklung von Cross-Plattform-Apps mit Xamarin, .NET MAUI und .NET. Mein Ziel sind glückliche Apps und zufriedene Anwender. Als Geschäftsführer der Cayas Software GmbH genieße ich die Freiheiten der neuen Plattform-Vielfalt und die sich daraus ergebenden Möglichkeiten.
I am currently working on porting a Xamarin Forms app to DOTNET MAUI. The app also uses maps from Apple or Google Maps to display locations. Even though there is no official support in MAUI yet, I want to show you a way to display maps via custom handler.
An important feature in the mobile area are maps capabilities. There isn't any app in the market that won't improve their value without a map. Apple and Google doing a great job with there Map-SDKs, but sometimes you hit a spot where they won't suit your needs. Maybe for legal reasons or because you hit a bug inside of them. The later was my case, which is happily resoleved with iOS 10. But I needed an alternative that works offline too.
We recently faced a problem that a customer published a version of his app that has a version code higher than 65.535 defined in the manifest file. All new builds have to have greater version codes. But building an Xamarin.Android app with that requirement will fail with the message: Error executing task Aapt: VersionCode is outside 0, 65535 interval. In this post I describe possible ways to work around this Xamarin.Android magic number when resetting the build-systems build number is not an option.