How to get .apk and .ipa file from flutter?
Asked Answered
B

14

141

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.

Blastema answered 1/6, 2018 at 14:29 Comment(1)
flutter.io/android-release/#building-a-release-apk. Maybe the debug apk is in a similar folder/pathPredisposition
G
94

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.

Georgena answered 1/6, 2018 at 15:26 Comment(4)
Using this method, if you share the apk and install that apk to another device, then it says app is not installed. Below answer works perfectly.Ovolo
This method won't work for Android debug apps. App won't get installed message will be shownHaggi
you can't install this apk on physical device , you have to create apk using command "( flutter build apk --release ) .Convent
If you are not an iOS person then may be you should not have answered the question. Also, the answers are wrong for android and generic for iOS!Neurosis
P
233

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
Pastry answered 4/8, 2018 at 4:26 Comment(9)
Hi, where can we locate debug build of ios (is it .ipa?), I want ios file on the lines of .apk to share it to client and testers. Tried and tired of no answers online, thank you!Durmast
Do we need a physical ios device to generate .ipa or is simulator enough?Durmast
You can find it in the build/outputs folder of your project, Further, it won’t give you an ipa file, instead it will give you a compiled application filePastry
ok, so one thing I'm confused about. On Android, after flutter build apk, I can do flutter install. What about after build iOS --debug or --release ... what do I do to install on the device?Patisserie
seems the same. I'll try it out.Patisserie
$flutter build ios --release gives this error "Building for iOS is only supported on the Mac."Baxie
Yes, because it needs Xcode to be installed which is only possible in a mackintoshPastry
But its giving me a apk of too big size like in my case i am getting apk of size 70mbUndertake
Flutter usually creates large apk sizes, but 70MB is too large for that too. Make sure you aren't using any dependency that is messing up with your apk size, try to analyse your apk and check which component is taking most of the space.Pastry
G
94

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.

Georgena answered 1/6, 2018 at 15:26 Comment(4)
Using this method, if you share the apk and install that apk to another device, then it says app is not installed. Below answer works perfectly.Ovolo
This method won't work for Android debug apps. App won't get installed message will be shownHaggi
you can't install this apk on physical device , you have to create apk using command "( flutter build apk --release ) .Convent
If you are not an iOS person then may be you should not have answered the question. Also, the answers are wrong for android and generic for iOS!Neurosis
H
31

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

Horsehide answered 8/5, 2020 at 7:52 Comment(0)
L
6

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.

Lubumbashi answered 15/3, 2021 at 0:43 Comment(0)
C
6

If you want this apk and .ipa with flavour then you can refer below commands for internal and production.

iOS:

flutter build ios --debug --flavor internal

flutter build ios --release --flavor production

android:

flutter build apk --debug --flavor internal

flutter build apk --release --flavor production

Curate answered 16/2, 2023 at 12:9 Comment(2)
And where is the .ipa file?Jalbert
you can find on below path 1) /build/ios/ipa 2) /build/ios/iphoneos/Runner.appCurate
P
4

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.

Pedraza answered 20/4, 2020 at 21:54 Comment(2)
I am trying to use above command ..but every time it shows command not found..I don't know what's going wrong at my end..Do I need to set any path for this on mac?Bracelet
make sure you are in the folder of the project.Pedraza
F
3

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.

Futuristic answered 23/11, 2019 at 17:16 Comment(1)
Don't you mean <project>/build/app/outputs/flutter-apk/app-debug.apk?Multiplex
B
2

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

Beamer answered 14/3, 2020 at 13:10 Comment(2)
Hi @Preethi G, could you please elaborate on your question? You can also follow the tutorial about how to answer: stackoverflow.com/help/how-to-answerNatch
@tashiro92 this is an answer, not a questionBernete
D
0

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.

Deportee answered 16/5, 2019 at 0:7 Comment(0)
P
0

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

Poplar answered 13/9, 2020 at 18:18 Comment(0)
C
0

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.

Cao answered 24/11, 2020 at 13:37 Comment(0)
S
0

I tried everything on the answers and nothing works with me!!

so i deleted flutter sdk folder and download it again The Flutter Sdk and restarted my ide and worked with me

Schmitz answered 8/12, 2023 at 1:51 Comment(0)
C
-1

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

Contention answered 12/3, 2019 at 7:55 Comment(0)
L
-2

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

Ladybug answered 16/4, 2021 at 17:30 Comment(1)
Your answer doesn't add anything new to the problem. Same solution is provided by many already.Cicada

© 2022 - 2025 — McMap. All rights reserved.