.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 SDKcurl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 6.0.100-rc.2.21505.57# Install .NET MAUI Optional Workload (which installs android, ios, etc workloads)~/.dotnet/dotnet workload install maui
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
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.

Explore more topics

App development

Best practices from engineers on how to use Bitrise to build better apps, faster.

Community

Meet other Bitrise engineers, technology experts, power users, partners and join our BUGs.

Company

All the updates about Bitrise events, sponsorships, employees, and more.

Insights

Mobile development, latest tech, industry insights, and interviews with experts.

Mobile DevOps

Learn why mobile development is unique and requires a set of unique practices.

Releases

Stay tuned for the last updates, new features, and product improvements.

Get the latest from Bitrise

Join other Mobile DevOps engineers who receive regular emails from Bitrise, filled with tips, news, and best practices.