MAUI Deployment Guide: Publish to Android, iOS, Windows & macOS

Build Once, Deploy Everywhere: Mastering .NET MAUI App Publishing
This post is part 10 of 10 in the series Mastering .NET MAUI: From Beginner to Pro

Are you still manually emailing APKs to testers and wondering why publishing your MAUI app feels like a medieval ritual? Let’s level up your deployment game.

.NET MAUI (Multi-platform App UI) lets you build cross-platform apps with a single codebase, but when it’s time to release, things can get tricky. In this guide, I’ll show you how to prepare, build, and publish your app properly across Android, iOS, Windows, and macOS. Spoiler: it involves more than just hitting Ctrl+Shift+B.

Preparing for Release

Before you unleash your app to the world, you need to ensure it’s ready for the spotlight.

Configuring the App for Production

  • Enable Release Configuration: Switch your build configuration from Debug to Release to disable debugging features and reduce overhead.
  • Set App Version and Build Number:

For Android: Edit the AndroidManifest.xml and .csproj file:

<PropertyGroup>
  <ApplicationVersion>1</ApplicationVersion>
  <ApplicationDisplayVersion>1.0.0</ApplicationDisplayVersion>
</PropertyGroup>

For iOS/macOS: Update the Info.plist:

<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
  • Optimize Resources:
    • Compress images using tools like TinyPNG.
    • Enable code linking to remove unused code:
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
  <Optimize>true</Optimize>
  <UseSharedCompilation>true</UseSharedCompilation>
  <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
  <PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>

App Packaging and Signing

  • Android:

Create a keystore:

keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

Configure signing in your csproj or in a SigningConfigs file.

  • iOS/macOS:
    • Sign in with your Apple Developer account in Visual Studio.
    • Use automatic provisioning or manually download certificates from Apple Developer Portal.
  • Windows:
    • Purchase a code signing certificate (or generate a test one).
    • Add it in your .csproj:
<PropertyGroup>
  <PackageCertificateThumbprint>YOUR_CERT_THUMBPRINT</PackageCertificateThumbprint>
  <PackageCertificateKeyFile>path/to/your.pfx</PackageCertificateKeyFile>
  <PackageCertificatePassword>your-password</PackageCertificatePassword>
</PropertyGroup>

Building for Android, iOS, Windows, macOS

Let’s talk output formats and build commands.

Generating APK, IPA, and MSIX

Each platform has unique output types and build requirements.

  • Android APK:
dotnet publish -f:net8.0-android -c Release -p:AndroidPackageFormat=apk
  • Use this for sideloading or internal testing.
  • Android AAB (for Play Store):
dotnet publish -f:net8.0-android -c Release -p:AndroidPackageFormat=bundle
  • Required for Google Play submission.
  • iOS IPA:
dotnet publish -f:net8.0-ios -c Release -p:BuildIpa=true
  • This builds an .ipa that you can upload to TestFlight or App Store.
  • Windows MSIX:
dotnet publish -f:net8.0-windows10.0.19041.0 -c Release
  • Results in a MSIX installer suitable for sideloading or Microsoft Store.
  • macOS PKG/App Bundle:
dotnet publish -f:net8.0-maccatalyst -c Release
  • Creates a .app bundle which can be further packaged into a .pkg installer.

Pro Tip: Always test the output package on a real device or emulator before submission. It ensures performance, compatibility, and avoids surprises during store reviews.

Code Signing and Certification

  • Why it matters: Code signing proves the app’s authenticity and ensures it’s not tampered with.
  • Android: Set the keystore path and password via environment variables or project file.
  • iOS/macOS: Use Keychain to manage signing identities and ensure Xcode command-line tools are installed.
  • Windows: Install the certificate in your personal store and use signtool.exe if needed.

Publishing to App Stores

Time to go live.

Submitting Apps to Google Play and App Store

  • Google Play:
    • Log into Google Play Console.
    • Create a new release under the Production track.
    • Upload the .aab file and complete app content, target audience, and privacy declarations.
    • Set up testing tracks (internal, closed, open) if needed.
    • Roll out the release gradually to monitor for issues.
  • App Store (iOS/macOS):
    • Use Xcode Transporter or altool to upload .ipa.
    • Configure app information in App Store Connect:
      • App name, description, keywords
      • App icon and screenshots
      • Version and build info
    • Complete compliance questions (export compliance, tracking policies).
    • Submit for review. Expect delays during holidays or for new developers.
  • Microsoft Store:
    • Use Partner Center to create a new app submission.
    • Upload the .msixbundle or .appxupload.
    • Complete the age rating questionnaire and description.
    • Monitor the certification report.

CI/CD Automation for Deployment

Automate everything (seriously):

  • Use GitHub Actions, Azure DevOps, or Bitrise.
  • CI/CD enables:
    • Pull-request-based builds
    • Automatic versioning
    • Signing and store submission
  • Example: GitHub Action to publish Android AAB:
jobs:
  build-android:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup .NET
        uses: actions/setup-dotnet@v3
        with:
          dotnet-version: 8.0.x
      - name: Restore dependencies
        run: dotnet restore
      - name: Build Android AAB
        run: dotnet publish -f:net8.0-android -c Release -p:AndroidPackageFormat=bundle

Add secure environment variables for signing credentials and upload scripts to further streamline the process.

FAQ: Common Questions on MAUI App Deployment

Can I build iOS apps on Windows?

Not directly. You need a Mac machine (physical or cloud-hosted) for iOS builds.

What if the app crashes only on Release mode?

Likely due to linker removing necessary code. Try <EnableTrimAnalyzer>false</EnableTrimAnalyzer> in csproj.

How do I handle multiple environment configs (dev, staging, prod)?

Use dotnet CLI profiles and MSBuild properties. Alternatively, load configs from appsettings.{Environment}.json.

Conclusion: Your App Deserves a Smooth Launch

Deploying a .NET MAUI app is like preparing for a rocket launch. Skipping pre-checks or automation will blow up on the pad.

Focus on release configuration, proper packaging, signing, and platform-specific nuances. With the power of CI/CD, you’re not just building apps—you’re running a professional release pipeline.

Ready to ditch manual uploads and zip files forever? Try setting up automated deployment today and let me know how it goes!

Leave a Reply

Your email address will not be published. Required fields are marked *