How to Build Flutter App In Release Mode for iOS ?
Flutter is an open-source UI software development kit created by Google. It is used to develop applications for Android, iOS, Linux, Mac, Windows, and the web from a single codebase. So in this article, we will go through How to Build Flutter App In Release Mode for iOS?
Are you as excited as us?
Let’s walk through it.
How to Build Flutter App In Release Mode for iOS?
Building Steps
If you have problems using the flutter command in the terminal because it is not found – read the Configuring steps below.
- Step 1: Open terminal, run command to navigate path
cd /Users/John/myFlutterApp/
Run
flutter build ios
Open Xcode and run .xcworkspace file in the iOS folder. It should now work smoothly and the Slow mode banner should be gone.
- Configuring steps
Step 1
Locate the folder where flutter is installed on your Mac. If it was installed using Android Studio. Just open Android Studio create a new flutter project and you will see the Flutter SDK path. For example, let it be /Users/John/flutter/
Step 2
Open a terminal on your Mac and run
cd /Users/John/
Step 3
run
export PATH=`pwd`/flutter/bin:$PATH
If you now run flutter in the terminal you should see a list of available params. So you can run
flutter doctor
To check if everything is fine with the installation. Now flutter command only works for this terminal session. And if you close it and later open it again and run fuller command – you will get an error that this command is unknown. So you want to save the flutter command to be available even after the terminal was closed.
Step 4
run
open ~/.bash_profile
you will see a text editor where you need to paste
export PATH=/Users/John/flutter/bin:$PATH
save the file. If you close the terminal now and open it again – you should be able to run the flutter command.
Users can also try the below way.
Even after running flutter build ios, Xcode always ran the Debug version (slow mode).
To solve this, I had to change the Build Configuration of the Run Schema
- Click on Runner, and Edit scheme
Click on Runner Flutter
- Select Release for the Build Configuration of Run Schema
Select Release iOS Flutter
When ever you run the project from Xcode it will be in release mode by default.
Conclusion:
In this article, We have been through How to Build Flutter App In Release Mode for iOS?
Thanks for Reading !!! Keep Fluttering !!!
Do share your suggestions/feedback on the same.
FlutterAgency.com is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget Guide, Flutter Projects, Code libs and etc.
FlutterAgency.com is one of the most popular online portal dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge on Flutter.