Release Guide for Flutter Apps

Recently, I worked on releasing a new version of a Flutter app, and it was quite an experience. In this blog, we will walk through the detailed steps required to release a new version of the flutter app.

Following this guide will help ensure that the release process is smooth, efficient, and error-free.

Sample Versioning

For this guide, we’ll use a sample version: 2.2.00+220000-SNAPSHOT.


1. Test Build

Before making any changes to the version, it’s essential to ensure the build process works correctly.

Start by running a test build(command): flutter build apk

This command will compile the app and generate an APK (Android Package) file for testing purposes.


2. Update the Version

Remove the -SNAPSHOT suffix from the version to indicate that this is a stable release.

Your version should now look like this: 2.2.00+220000


3. Commit Changes

Next, commit these changes to your version control system. Use the following commands:

git add .

git commit -m "building apk for release agent-2.2.00"

git push origin master


This ensures that your version updates are tracked and saved in your repository.


3. Tag the Release

Tagging the release helps in identifying the specific point in the repository history that corresponds to this version.

Use the following commands:

git tag agent-2.2.00

git push origin agent-2.2.00


3. Build Release APKs

Now, create the release builds for both staging and production environments.

Staging Build command for Apk and Bundle files:

flutter build apk

flutter build appbundle

  • Production Build command for Apk and Bundle files:

flutter build apk -t lib/flavor/prd.dart

flutter build appbundle -t lib/flavor/prd.dart


Once the APK is created, you need to navigate to the root folder of your project and then go to build/app/outputs/flutter-apk There, you will find the release APK.

  • If it’s a staging APK, rename it to appname-versionNumber-stg.apk
  • If it’s a production APK, rename it to appname-versionNumber-prd.apk

For example, if your app’s name is “MyApp” and the version number is “1.0.0”:

  • Staging APK: MyApp-1.0.0-stg.apk
  • Production APK: MyApp-1.0.0-prd.apk

To differentiate the production and staging builds, I used Flutter flavors. This allows for managing multiple environments efficiently within the same project. You can read more about how to set up and use Flutter flavors in my detailed blog post.


6. iOS Release

1. Test & Production Build:

  • Run a test and prd builds:

flutter build ios //for test environment

flutter build ios -t lib/flavors/prd.dart //for prd environment

  • Open the generated Xcode project and build it:

2. Update Version:

  • In the Xcode project, go to the Runner target.
  • Under the “General” tab, update the “Version” and “Build” numbers.

3. Archive and Export:

  • In Xcode, go to “Product” -> “Archive.”
  • In the Organizer window, select the archive and click “Distribute App.”
  • Choose “App Store Connect.”
  • Select your app in App Store Connect.
  • Upload the exported IPA file.

4. Submit for Review:

  • Fill in the required information, including screenshots and descriptions.
  • Submit the app for review.


7. Git Tag Release


1. Visit Your GitHub Repository

  • Log in to GitHub and navigate to your repository.

2. Navigate to the Tagged Version

  • Click on the “Code” tab and then click “Tags”.
Navigate to the tagged version
  • Find and click on the tag for the version you want to release.


3. Create a New Release

  • Click “Draft a new release.”
  • Enter a title (e.g., “Release v1.0.0”) and a description summarizing the changes in the marked first box.
  • Scroll down and drag-drop or select your staging ( MyApp-1.0.0-stg.apk)and production (MyApp-1.0.0-prd.apk)APK files in the second marked box.
create a new release


4. Publish the Release

  • Review your release details.
  • Click “Publish release” to make it public.
  • Once you published the new release you can find the latest release in the repository code page right side bottom
publish the release


8. Git Tag Release


Once the APKs are ready and tagged, the next step is to upload them to the Google Play Store.


Ensure you follow the Play Store’s guidelines for releasing new versions.


9. Increment the Version Number


After a successful release, increment the version number and build number. Append the -SNAPSHOT


suffix to indicate that this is a development version: 2.2.01+220100-SNAPSHOT


10. Commit the Snapshot Version


Finally, commit the updated snapshot version to your version control system: 


git add .

git commit -m "increment version to 2.2.01+220100-SNAPSHOT"

git push origin master


By following these steps of commands, you ensure that the release process for the flutter app is thorough and well-documented, reducing the risk of errors and improving the reliability of each new version deployed.

WRITTEN BY
Aathithyan Siriramachchanthiran

Our latest blogs

Dive into our blogs and gain insights

"Startups and product development"

State management is a crucial aspect of building robust and maintainable... 

"BrowserStack"

Losing a keystore file, which is essential for signing an Android application ...

"Demystifying serverless computing"

A regular expression is a sequence of characters that pattern in text....

Have you got an idea?

Transform your vision into reality with our custom software solutions, designed to meet your unique needs and aspirations.

"Have you got an idea?"