English 中文(简体)
Flutter - Deployment
  • 时间:2024-09-08

Flutter - Deployment


Previous Page Next Page  

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

Android Apppcation

    Change the apppcation 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 apppcation. We can set the apppcation 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/apppcation 
flutter build apk

    You can see an output as shown below −


Initiapzing gradle...                                            8.6s 
Resolving dependencies...                                        19.9s 
Calpng 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

    Pubpsh the apppcation into Google Playstore by creating an appbundle and push it into playstore using standard methods.


flutter build appbundle

iOS Apppcation

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

    Update Display name in the XCode project setting to set the apppcation 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 apppcation by pushing the apppcation, IPA file into TestFpght using standard method.

    Finally, push the apppcation into App Store using standard method.

Advertisements