
Mobile app releases break more often because of process gaps than code issues. CI/CD helps eliminate that unpredictability. For Flutter teams shipping to both Android and iOS, having a structured build and distribution pipeline is no longer optional, it directly impacts release speed, stability, and team confidence.
I’m writing this guide to simplify how you can implement CI/CD for Flutter using App Center without adding unnecessary complexity. From code commit to production-ready builds, this walkthrough focuses on creating a dependable, repeatable delivery workflow.
CI/CD is a software development practice that automates code integration, testing, and deployment to ensure reliable and repeatable releases.
Continuous Integration (CI): CI is a process where developers frequently merge code into a shared repository, and automated checks validate builds and detect issues early.
Continuous Delivery/Deployment (CD): CD is a process that automatically builds, tests, and prepares applications for release, ensuring code changes move to production in a controlled and predictable way.
Benefits of CI/CD:
CI/CD improves release reliability, reduces deployment risk, and shortens development cycles through automation and structured validation.
Accelerated Delivery:
Automated builds and tests reduce manual effort and enable faster, predictable releases.
Early Detection of Issues:
Pull requests are automatically validated for build errors, dependency conflicts, and quality violations before reaching production.
More Stable Production Setup:
Consistent deployment pipelines reduce configuration drift between development, staging, and production environments.
Enhanced Collaboration:
Frequent integrations minimize merge conflicts and improve transparency across teams.
Iterative Development:
Smaller, controlled releases allow faster feedback and safer experimentation.
CI/CD for Flutter Applications
In the following sections, we'll explore implementing CI/CD pipelines for Flutter applications using App Center. We'll delve into best practices, practical tips, and real-world examples to help you master CI/CD for your Flutter projects.
Flutter is an open-source UI framework developed by Google for building natively compiled applications across mobile, web, and desktop from a single codebase. Released in 2018, it enables high-performance cross-platform development by compiling directly to native machine code and rendering UI through its own engine.
Interested in a more in-depth comparison? Check out our blog post: exploring Flutter vs React Native
App Center is a cloud-based DevOps platform by Microsoft designed to automate mobile app build, test, distribution, and monitoring workflows. It centralizes CI/CD processes, enabling teams to configure build pipelines, manage releases, collect crash reports, and analyze app performance from a single dashboard.
Combining Flutter’s cross-platform architecture with App Center’s CI/CD capabilities creates a structured workflow for building, validating, and distributing mobile applications efficiently. This setup improves release consistency, reduces deployment risk, and supports scalable mobile development practices.
Flutter provides a unified development architecture, and App Center enables structured CI/CD automation. Configuring App Center for your Flutter project allows you to automate builds, manage testing workflows, and control application distribution across Android and iOS.
The following steps outline how to configure App Center for a Flutter project:
You will use this app configuration in later steps to connect your repository and configure build settings.
Step 1: Add a New App in App Center
Open the App Center dashboard and select “Add new app.”
Provide the following details:
This step initializes your Android app configuration and prepares it for repository connection and build pipeline setup.
Step 2: Add the App Center Build Script (Android)
The appcenter-post-clone.sh script runs automatically after App Center clones your repository. It installs Flutter, prepares dependencies, and builds the Android artifact during the CI process.
Work with our expert team to turn your app idea into a fast, stunning Flutter product.
To configure it:
flutterApp/android/appappcenter-post-clone.shThis script ensures the App Center build environment is correctly prepared for Flutter compilation.
Paste the following content into the script:
#!/usr/bin/env bash
#Place this script in project/android/app/
cd ..
# fail if any command fails
set -e
# debug log
set -x
cd ..
git clone -b stable https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
flutter channel stable
flutter doctor -v
echo "Installed flutter to `pwd`/flutter"
# build APK
flutter clean
flutter pub get
flutter build -v apk --release
# if you need to build bundle (AAB) in addition to your APK, uncomment the following line below and last line of this script.
#flutter build appbundle
# copy the APK where AppCenter can find it
mkdir -p android/app/build/outputs/apk/; mv build/app/outputs/apk/release/app-release.apk $_
# copy the AAB where AppCenter can find it
#mkdir -p android/app/build/outputs/bundle/; mv build/app/outputs/bundle/release/app.aab $_appcenter-post-clone.sh
Step 3: Update the Android .gitignore File
Open the .gitignore file located in:android/.gitignore
Ensure the following entries are properly configured (uncomment if necessary) so that required Gradle wrapper files are included in version control:
gradlew
gradlew.batKeeping these files tracked ensures App Center can execute Gradle commands correctly during the CI build process.
The updated android/.gitignore file should resemble the following:
# gradle-wrapper.jar
/.gradle
/captures/
# /gradlew
# /gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jksThis configuration ensures required build files are tracked while sensitive signing credentials remain excluded.
Step 4: Committing and Pushing Changes
Add the newly created appcenter-post-clone.sh script and the updated .gitignore file to version control.
Commit the changes and push them to your remote repository (e.g., GitHub or GitLab) so App Center can access the updated configuration during the build process.
Step 5: Configuring Build in App Center
Open your app in the App Center dashboard and navigate to the Build tab.
If App Center does not detect the Android project, verify that Step 3 was completed and that the latest changes are pushed to the selected branch.
Under Environment Variables, add:
JAVA_HOME$(JAVA_HOME_11_X64)In the Build Scripts section, confirm that appcenter-post-clone.sh is detected. This confirms the script integration is active.
Finally, select your build trigger preference:
Consider build time limits (free tier includes 4 build hours per month). Android and iOS builds typically take 5–10 minutes per run.
Step 6: Ensuring App Signing for Android
In the App Center build configuration, upload a valid JKS keystore file for signing the release build.
Provide the required credentials:
If you have not generated a keystore file, create one using Android Studio’s key generation process before proceeding.
Proper signing ensures the release APK or AAB can be installed and distributed securely.
Step 7: Building and Distributing Your App
After completing the configuration:
You can distribute the APK via Over-the-Air (OTA) delivery to registered collaborators or download the artifact directly.
While automatic builds can be enabled for every commit, using manual distribution helps control build usage and resource consumption. Trigger builds after meaningful changes to maintain efficiency and optimize CI runtime.
Here's a breakdown of the benefits of manual distribution in App Center:
App Center does not natively execute Flutter UI tests by default. To enable automated UI validation:
appcenter-post-clone.sh script to execute the test suite during the build process and surface results within the CI workflow.This approach integrates UI validation into your existing build pipeline, improving release confidence before distribution.
Build Failures and Notifications:
App Center automatically sends email notifications when a build fails.
You can configure additional notification channels, such as Slack, by integrating App Center with your workspace using webhooks or third-party workflow automation tools.
Timely failure alerts help maintain pipeline stability and reduce downtime between commits and fixes.
After configuring the Android build pipeline, the next step is to set up App Center for the iOS environment. This involves connecting the repository, configuring build settings, and managing signing credentials required for iOS distribution.
The following steps outline the iOS configuration process.
Work with our expert team to turn your app idea into a fast, stunning Flutter product.
Sign in to the App Center dashboard.
Select “Add new” → “Add new app.”
Provide the required details:
Click “Add new app” to register the iOS project configuration.
Open the iOS app in App Center and navigate to the Build tab.
Click “Connect” to link your source control repository (e.g., GitHub or GitLab).
Authenticate with your selected service and choose the repository and branch containing your Flutter project.
This connection enables App Center to trigger builds from your selected codebase.
Create an appcenter-post-clone.sh script inside the iOS project directory:
flutterApp/ios/appcenter-post-clone.sh
This script prepares the Flutter environment during the CI process and ensures dependencies are installed before the iOS build runs.
After adding the required commands to the script, commit and push the file to your repository so App Center can execute it during the build.
#!/usr/bin/env bash
#Place this script inside project/ios/
# fail if any command fails
set -e
# debug log
set -x
cd ..
git clone -b stable https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
flutter channel stable
flutter doctor
echo "Installed flutter to `pwd`/flutter"
cd ./ios
flutter precache --ios
flutter pub get
appcenter-post-clone.sh
Open the iOS app in App Center and navigate to the Build section.
If the iOS project appears under “Build app,” the repository integration is successful.
Enable the “Sign builds” option to allow App Center to generate a signed iOS build.
You will need to upload:
.mobileprovision).p12)These files can be generated or downloaded from the Apple Developer Portal under Certificates, Identifiers & Profiles.
Proper signing configuration is required for installing the app on physical devices or distributing it through TestFlight or the App Store.
Before building our iOS app, we need to make sure it's signed properly to run on a real device. Apps on iPhones and iPads, can only run if they have a digital signature created using Apple's code signing tools.
Requirements:
Signing Process:
After a successful build, use App Center’s Distribute feature to release the iOS build to the selected tester group or distribution channel.
With both Android and iOS pipelines configured, your Flutter project now operates under a structured CI/CD workflow. This setup enables automated builds, controlled releases, and consistent cross-platform delivery.
This guide covered how CI/CD improves release reliability and how Flutter integrates with App Center to automate builds and distribution across Android and iOS.
The Flutter ecosystem also supports alternative CI/CD solutions such as Codemagic, fastlane, and Xcode Cloud for iOS workflows. The appropriate choice depends on project scale, team structure, and release requirements.
While App Center provides structured automation, manual build and signing processes may be suitable for smaller projects or controlled release environments.
A well-configured CI/CD pipeline ensures consistent builds, controlled deployments, and reduced production risk in cross-platform Flutter development.