Flutter Deployment

Flutter - Introduction to Dart Programming

Flutter Deployment

Once you've built a Flutter application, the next step is deployment, which means preparing and publishing your app on the Google Play Store (Android) or the Apple App Store (iOS). Below is a step-by-step guide for deploying your Flutter app on both platforms.

1. Preparing for Deployment (Common Steps for Android and iOS) Update pubspec.yaml

Make sure your pubspec.yaml file contains a proper app name, description, and dependencies.


  name: my_flutter_app
  description: A new Flutter application
  version: 1.0.0+1

  1. version: 1.0.0+1
  2. 1.0.0 → App version (Major.Minor.Patch)
  3. +1 → Build number (increases with every new build)

Optimize Assets and Code
  1. Remove unused assets and code.
  2. Minify and obfuscate Dart code using:
  3. flutter build apk --release --obfuscate --split-debug-info=debug-info

  4. Reduce app size by enabling ProGuard (Android).

1. Deploying Flutter App on Android

Update Android App Manifest (AndroidManifest.xml) Located at:

android/app/src/main/AndroidManifest.xml

Set App Name:

  <application 
      android:label="My Flutter App" 
      android:icon="@mipmap/ic_launcher">

Set Permissions (if required):

  <uses-permission 
      android:name="android.permission.INTERNET" />

Configure build.gradle Files

Project-level android/build.gradle

Ensure the minimum SDK version is set correctly:

ext.kotlin_version = '1.7.10'


App-levelandroid/app/build.gradle

Set minSdkVersion and targetSdkVersion


  defaultConfig {
    applicationId "com.example.myflutterapp"
    minSdkVersion 21
    targetSdkVersion 34
    versionCode 1
    versionName "1.0.0"
  }

Generate Signed APK or App Bundle

To publish your app, you need to generate a signed APK or App Bundle (AAB).

Generate a Keystore (only needed once) Run the following command:

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

Move the generated my-release-key.jks file to:

android/app/

Update key.properties File

Create a file android/key.properties and add:

storeFile=../app/my-release-key.jks
storePassword=my_store_password
keyPassword=my_key_password
keyAlias=my-key-alias

Modify build.gradle to Sign APK

Edit android/app/build.gradle:


  android {
    signingConfigs {
        release {
            storeFile file('../key.properties')
            storePassword 'my_store_password'
            keyPassword 'my_key_password'
            keyAlias 'my-key-alias'
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
  }

Build APK or AAB

Run either of the following commands:

  1. For APK (smaller size, easier to distribute):
  2. flutter build apk --release

  3. For App Bundle (recommended for Play Store):
  4. flutter build appbundle


Upload to Google Play Store

  1. Go to Google Play Console.
  2. Create a new app and fill in details.
  3. Upload the AAB file under "Production" → "Release".
  4. Fill in Store Listing, App Content, and Pricing.
  5. Submit for review and publishing.

3. Deploying on iOS (App Store)

Install Xcode and Setup iOS Development Environment
  1. Install Xcode from the Mac App Store.
  2. Install CocoaPods:

sudo gem install cocoapods


Update iOS App Configuration

  1. Open ios/Runner.xcodeproj in Xcode.
  2. Go to Runner → General → Identity and set:
  3. Display Name: (App Name)
  4. Bundle Identifier: (e.g., com.example.myflutterapp)
  5. Version and Build Number

Setup Signing and Capabilities

  1. In Xcode, open Runner → Signing and Capabilities.
  2. Enable Automatically manage signing.
  3. Select your Apple Developer Team.
  4. Ensure the app’s Bundle Identifier matches your App Store settings.

Build iOS App

Run on a Physical Device (iPhone)

Connect your iPhone via USB and run:

flutter build ios --release


Archive and Upload to App Store
  • Open the Runner.xcworkspace in Xcode:
  • open ios/Runner.xcworkspace

  • In Xcode, select Product → Archive.
  • Once archived, click Distribute App → App Store Connect.
  • Upload the build to App Store Connect.

Submit App for Review

  • Go to App Store Connect.
  • Select your app and go to App Store → Prepare for Submission.
  • Fill in app details, screenshots, and privacy policy.
  • Submit for App Store Review.
أحدث أقدم