.NET MAUI apps on Bitrise

We are in discussions with Microsoft about the support of Xamarin and .NET MAUI on Bitrise, and this is what we know now, months before the planned prod-ready release in Q2, 2022.

We are in discussions with Microsoft about the support of Xamarin and .NET MAUI on Bitrise, and this is what we know now, months before the planned prod-ready release in Q2, 2022.

At the moment we don’t have any changes in the timeline of the Xamarin deprecation, but we can share some good news on building .NET MAUI apps on Bitrise: thanks to the cooperation with Microsoft we now have a working example of using MAUI on Bitrise even after the Visual Studio stack deprecation.

Sample repository

We have used this repository to demonstrate using MAUI on Bitrise, on macOS stacks:

BigIslandBarcoding

Adding the sample app to Bitrise

1. Add a new Bitrise app

After logging in to Bitrise, click “Add new app / Web UI“ and use the Git repo above as the source of the project. (Either fork it to your own account or add it under Other/Manual.)

2. Select platform manually

Please note that when you add your MAUI app to Bitrise, the project scanner will not recognize the platform as MAUI is not fully supported on Bitrise.

Use the manual platform selector and choose “Other/manual”. This will give you access to macOS-based VMs with Xcode preinstalled.

3. Select a macOS stack

We recommend the latest stable Xcode version.

Set up your workflow to build the app

The first build will use a generic workflow, but there is a MAUI-specific bitrise.yml configuration in the Git repository.

Click “Edit workflow” on the first build’s page, then head over to the “bitrise.yml” tab of the workflow editor. Here you can set Bitrise to read bitrise.yml from the app repository.

Alternatively, you can copy the contents of the bitrise.yml from the repo to the workflow editor.

Next, click on the app's name on the top and then Start a build manually. If you pick the primary workflow, it should use the updated workflow from the git repository.

Overview of the workflow

1. Certificate and profile installer
This step installs your iOS certificates and profiles on the build VM. There are some wildcard certificates installed by default, but make sure to upload your real certificates to Bitrise. For more information, check out our documentation on iOS code signing.

2. Install… steps
The workflow installs the required .NET SDK and other components for building Android and iOS apps.


# Install .NET SDK
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 6.0.100-rc.2.21505.57 
Copy code


3. Build Android app
Builds the .apk + .aab:

~/.dotnet/dotnet publish ./BigIslandBarcode/BigIslandBarcode.csproj -f net6.0-android -c Release
Copy code

4. Build iOS app
Builds the .ipa and moves to $BITRISE_DEPLOY_DIR:


~/.dotnet/dotnet publish ./BigIslandBarcode/BigIslandBarcode.csproj -f net6.0-ios -c Release -p:BuildIpa=True -p:IpaPackagePath=$BITRISE_DEPLOY_DIR/codes.redth.bigislandbarcode.ipa
Copy code

5. Deploy to Bitrise.io
This step publishes files in $BITRISE_DEPLOY_DIR as build artifacts that you can download after the build finished.

Try this method and let us know how it went.

Happy building!

No items found.
The Mobile DevOps Newsletter

Explore more topics

App Development

Learn how to optimize your mobile app deployment processes for iOS, Android, Flutter, ReactNative, and more

Bitrise & Community

Check out the latest from Bitrise and the community. Learn about the upcoming mobile events, employee spotlights, women in tech, and more

Bitrise Insights

Cache | Caching

Mobile App Releases

Learn how to release faster, better apps on the App Store, Google Play Store, Huawei AppGallery, and other app stores

Mobile DevOps

Learn Mobile DevOps best practices such as DevOps for iOS, Android, and industry-specific DevOps tips for mobile engineers

Mobile Testing & Security

Learn how to optimize mobile testing and security — from automated security checks to robust mobile testing and more.

Product Updates

Check out the latest product updates from Bitrise — Build Insights updates, product news, and more.

The Mobile DevOps Newsletter

Join 1000s of your peers. Sign up to receive Mobile DevOps tips, news, and best practice guides once every two weeks.