74
votes

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.

13
flutter.io/android-release/#building-a-release-apk. Maybe the debug apk is in a similar folder/pathFreshD

13 Answers

77
votes

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.

124
votes

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
22
votes

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

12
votes

Building .apk

Although app bundles are preferred over APKs, there are stores that don’t yet support app bundles. In this case, build a release APK for each target ABI (Application Binary Interface).

From the command line:

  • Run flutter build apk --split-per-abi

    (The flutter build command defaults to --release.)

Building .ipa

To create a .ipa file, Build and release an iOS app

  1. Register your app on App Store Connect

  2. Review Xcode project settings, see the Xcode project settings

  3. Create a build archive

    In Xcode, configure the app version and build:

    1. In Xcode, open Runner.xcworkspace in your app’s ios folder.

    2. Select Product > Scheme > Runner.

    3. Select Product > Destination > Generic iOS Device.

    4. Select Product > Archive. (This process will take a little longer)

      enter image description here

    5. After finishing the process - Click the "Distribute App" button on right panel enter image description here

    6. Then follow the below steps

      • Step 1

        enter image description here

      • Step 2 enter image description here

      • Step 3

        enter image description here

      • Step 4 enter image description here

      • Step 5 enter image description here

      • Step 6 (Finally select the place you want to save the .ipa file ) enter image description here

3
votes

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.

1
votes

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

0
votes

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.

0
votes

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.

0
votes

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

0
votes

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.

0
votes

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.

-1
votes

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

-2
votes

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