132

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.

Christopher Moore
  • 15,626
  • 10
  • 42
  • 52
Ammy Kang
  • 11,283
  • 21
  • 46
  • 68
  • 1
    https://flutter.io/android-release/#building-a-release-apk. Maybe the debug apk is in a similar folder/path – FreshD Jun 01 '18 at 14:45

13 Answers13

221

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
Adolf Dsilva
  • 13,092
  • 8
  • 34
  • 45
Jaswant Singh
  • 9,900
  • 8
  • 29
  • 50
  • 1
    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! – John Ravi Mar 02 '19 at 05:11
  • Do we need a physical ios device to generate .ipa or is simulator enough? – John Ravi Mar 02 '19 at 06:15
  • 2
    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 file – Jaswant Singh Mar 02 '19 at 09:13
  • 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? – naim5am Mar 08 '19 at 21:43
  • seems the same. I'll try it out. – naim5am Mar 08 '19 at 21:44
  • $flutter build ios --release gives this error "Building for iOS is only supported on the Mac." – The Billionaire Guy Mar 09 '19 at 19:44
  • Yes, because it needs Xcode to be installed which is only possible in a mackintosh – Jaswant Singh Mar 10 '19 at 13:24
  • But its giving me a apk of too big size like in my case i am getting apk of size 70mb – B.shruti May 28 '20 at 11:37
  • 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. – Jaswant Singh May 28 '20 at 15:29
92

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.

Edman
  • 5,335
  • 29
  • 32
  • 7
    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. – Smeet Apr 16 '20 at 15:02
  • This method won't work for Android debug apps. App won't get installed message will be shown – Manoj Perumarath May 04 '21 at 14:27
  • 1
    you can't install this apk on physical device , you have to create apk using command "( flutter build apk --release ) . – Waqas ali Jun 15 '21 at 07:26
  • 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! – Anoop Thiruonam Nov 27 '21 at 07:50
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

Prince Hodonou
  • 615
  • 1
  • 9
  • 15
5

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.

Jack'
  • 1,722
  • 1
  • 19
  • 27
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.

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121
Aashar Wahla
  • 2,785
  • 1
  • 13
  • 19
  • 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? – bittu Dec 07 '20 at 08:25
  • make sure you are in the folder of the project. – Aashar Wahla Dec 13 '20 at 10:01
4

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

Dilip
  • 2,622
  • 1
  • 20
  • 27
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.

Tarun Sharma
  • 914
  • 9
  • 15
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

Preethi G
  • 21
  • 2
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.

yug k
  • 349
  • 4
  • 9
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

Jitesh Mohite
  • 31,138
  • 12
  • 157
  • 147
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.

Kishan Somaiya
  • 109
  • 1
  • 11
-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

Kiran Jadhav
  • 3,209
  • 26
  • 29
-2

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