How to get .apk and .ipa file from flutter?

FlutterApkIpaFlutter Ios

Flutter Problem Overview


I am new to flutter programming and I've created a demo app, its running fine on both android and iOS devices. I want to see .apk and .ipa file in flutter. Can anyone help me to get these files from Flutter? Where can I see these files in folders or is there any other solution.

Flutter Solutions


Solution 1 - Flutter

For apk (Android) you need to run the command :

flutter build apk --release

If you want to split the apks per abi (Split Apk) then run

flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi

For ipa (iOS) you need to run the command :

flutter build ios --release

From the console

P.S. --release is optional as it is by default if you need debug build, just replace --release with --debug

you can find the released APK or IPA files form

build/app/outputs/flutter-apk/app-release.apk

Solution 2 - Flutter

For Android an APK is generated every time you build the app, e.g. with flutter run. You will find that in your project folder under <project>/build/app/outputs/apk/debug/app-debug.apk. If you want a release APK, have a look at the docs.

I'm not an iOS person, so I'm not sure an IPA is generated during development as in android. But looking at these docs it seems you can follow the standard steps on xcode to get it, as shown here.

Solution 3 - Flutter

For apk (Android) run the command :

flutter build apk --release

For ipa (iOS) run the command :

flutter build ios --release

Then to get actual .ipa file, open xcode -> Product -> archive -> Distribute App -> Ad Hoc -> Export

You can then save the .ipa(which is inside the Runner folder) file in any location

Solution 4 - Flutter

For Android, an APK is generated every time you build the app, e.g. with flutter run. You will find that in your project folder under <project>/build/app/outputs/apk/debug/app-debug.apk.

Solution 5 - Flutter

I also had this question and had a really tough time finding the right solution. First of all in the terminal of your code editor type:

flutter build apk --release

and after that go to this location:

yourAppFolder/build/app/outputs/apk/release/app-release.apk

I do not do development for iOS so I don't know much about that.

Solution 6 - Flutter

Follow below steps to get .apk and .ipa from flutter app in Mac system

  1. First, Enter below command in your terminal to go your project directory

    cd $(PROJECT FOLDER PATH)

  2. For android apk build to upload store, Enter below command

    sudo $(FLUTTER SDK PATH till bin)/flutter build apk --release

  3. To get ios ipa , Enter below command

    sudo $(FLUTTER SDK PATH till bin)/flutter build ios --release

Solution 7 - Flutter

For iOS:

Step 1: open terminal and type cd "your flutter sdk path"

Step 2: cd export PATH=/Users/yourname/Downloads/flutter/bin:$PATH

Step 3: cd your project path

Step 4: flutter build ios --release

run step 1 to 4 in terminal.

After that open android studio and go to iOS folder path and open project.pbxproj file with ios module and in xcode you need to choose generic ios device and select archive, it will generate ipa build for you.

Solution 8 - Flutter

Android(After adding release build type run below command which will generate release apk with below version)

flutter build apk --build-name=1.0.1 --build-number=1

iOS

flutter build ios --release

For a detail explanation read the below article.

https://medium.com/@ralphbergmann/versioning-with-flutter-299869e68af4

Solution 9 - Flutter

For apk, you can use flutter build apk --release to get the release version of your apk on either windows/macOS.

For ipa, you have to use flutter build ios --release to get the release version of your apk on macOS.

Note: You can get a ipa on macOS only.

Solution 10 - Flutter

To get an apk, it is simple. Just use :

flutter build apk

To get an ipa, It is more complicated. First use :

flutter build ipa

Be careful to use flutter build ipa, not flutter build ios, because the second one builds a ".app" file instead of ".xcarchives" file.

Once you have the ".xcarchives" file, you can open it in XCode and click on "Distribute the app" to export an ipa file on your computer.

Solution 11 - Flutter

> Updated for iOS :-

first you need to go to your current working directory and run the following command;

flutter build ios --release

After successfully completion of build, you can find build on below path;

/Users/sanjaybalaji/Documents/KiranFlutterApps/hb_calculator/build/ios/iphoneos/Runn
er.app.

you can check below screenshots for more details.

enter image description here

enter image description here

Solution 12 - Flutter

You can find your app apk after you run the app at path /build/app/outputs/flutter-apk/app.apk

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAmmy KangView Question on Stackoverflow
Solution 1 - FlutterJaswant SinghView Answer on Stackoverflow
Solution 2 - FlutterEdmanView Answer on Stackoverflow
Solution 3 - FlutterPrince HodonouView Answer on Stackoverflow
Solution 4 - FlutterTarun SharmaView Answer on Stackoverflow
Solution 5 - FlutterAashar WahlaView Answer on Stackoverflow
Solution 6 - FlutterPreethi GView Answer on Stackoverflow
Solution 7 - Flutteryug kView Answer on Stackoverflow
Solution 8 - FlutterJitesh MohiteView Answer on Stackoverflow
Solution 9 - FlutterKishan SomaiyaView Answer on Stackoverflow
Solution 10 - FlutterJack'View Answer on Stackoverflow
Solution 11 - FlutterKiran JadhavView Answer on Stackoverflow
Solution 12 - FlutterGourav GovandeView Answer on Stackoverflow