Flutter - Deployment


Advertisements

This chapter explains how to deploy Flutter application in both Android and iOS platforms.

Android Application

  • Change the application name using android:label entry in android manifest file. Android app manifest file, AndroidManifest.xml is located in <app dir>/android/app/src/main. It contains entire details about an android application. We can set the application name using android:label entry.

  • Change launcher icon using android:icon entry in manifest file.

  • Sign the app using standard option as necessary.

  • Enable Proguard and Obfuscation using standard option, if necessary.

  • Create a release APK file by running below command −

cd /path/to/my/application 
flutter build apk
  • You can see an output as shown below −

Initializing gradle...                                            8.6s 
Resolving dependencies...                                        19.9s 
Calling mockable JAR artifact transform to create file: 
/Users/.gradle/caches/transforms-1/files-1.1/android.jar/ 
c30932f130afbf3fd90c131ef9069a0b/android.jar with input 
/Users/Library/Android/sdk/platforms/android-28/android.jar 
Running Gradle task 'assembleRelease'... 
Running Gradle task 'assembleRelease'... 
Done                                                             85.7s 
Built build/app/outputs/apk/release/app-release.apk (4.8MB).
  • Install the APK on a device using the following command −

flutter install
  • Publish the application into Google Playstore by creating an appbundle and push it into playstore using standard methods.

flutter build appbundle

iOS Application

  • Register the iOS application in App Store Connect using standard method. Save the =Bundle ID used while registering the application.

  • Update Display name in the XCode project setting to set the application name.

  • Update Bundle Identifier in the XCode project setting to set the bundle id, which we used in step 1.

  • Code sign as necessary using standard method.

  • Add a new app icon as necessary using standard method.

  • Generate IPA file using the following command −

flutter build ios
  • Now, you can see the following output −

Building com.example.MyApp for device (ios-release)... 
Automatically signing iOS for device deployment 
using specified development team in Xcode project: 
Running Xcode build...                                   23.5s 
......................
  • Test the application by pushing the application, IPA file into TestFlight using standard method.

  • Finally, push the application into App Store using standard method.

Advertisements