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 Answers
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.
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
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
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
Register your app on App Store Connect
- Register a Bundle ID, see the Register a Bundle ID
- Create an application record on App Store Connect, see the Create an application record on App Store
Review Xcode project settings, see the Xcode project settings
Create a build archive
In Xcode, configure the app version and build:
In Xcode, open Runner.xcworkspace in your app’s ios folder.
Select Product > Scheme > Runner.
Select Product > Destination > Generic iOS Device.
Select Product > Archive. (This process will take a little longer)
After finishing the process - Click the "Distribute App" button on right panel
Then follow the below steps
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.
Follow below steps to get .apk and .ipa from flutter app in Mac system
First, Enter below command in your terminal to go your project directory
cd $(PROJECT FOLDER PATH)
For android apk build to upload store, Enter below command
sudo $(FLUTTER SDK PATH till bin)/flutter build apk --release
To get ios ipa , Enter below command
sudo $(FLUTTER SDK PATH till bin)/flutter build ios --release
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.
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
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.
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.