Difference between `flutter run` and `flutter build` command?

Viewed 5701

I'm new to Flutter dev and I'd like to know the difference between flutter run command and flutter build command.

Thanks.

3 Answers

You need to use flutter build command with one of following parameters: apk, appbundle, ios. This will produce an application to deploy or publish on AppStore, PlayStore, or some other distribution channels like Firebase.

The flutter run command will run your application on a connected device, or iOS simulator, or Android Emulator. You can also use --verbose command to get a detailed log while running the application.

The command flutter run --release compiles to release mode. Your IDE supports this mode. Android Studio, for example, provides a Run > Run… menu option, as well as a triangular green run button icon on the project page. You can compile to release mode for a specific target with flutter build .

This doc explains it all

By default, flutter run compiles to debug mode

You can compile to release mode for a specific target with flutter build

Related