DEV Community

Cover image for Important Flutter CLI Commands Cheat Sheet.
Areeba Farooq
Areeba Farooq

Posted on

Important Flutter CLI Commands Cheat Sheet.

Are you a Flutter developer looking for a CLI command reference?😃

If yes, you must be curious about the different ways you can interact with the Flutter application.🤔

Flutter comes with the handy CLI (Command Line Interface).😌
It lets you do the same tasks that you perform using IDE.😮

This post will help you get a quick reference to the most important CLI commands that are used in almost all Flutter projects.💯

Commands are for:

✨Initialization.
✨Flutter build.
✨Flutter clean.
✨Flutter run.
✨Attaching existing app.
✨Flutter install.
✨Running test files.
✨Flutter code analysis.
✨Flutter bug/error reporting.
✨Flutter config.

.

.

.

.

✨Initialization:

Create various files for the initial Flutter project in the specified directory as a skeleton code.

Image description
__

✨Flutter Build:

Deploy flutter apps into devices both ios and android by creating binary files. It can have some arguments like for release or debug.

Image description
__

✨Flutter Clean:

Delete the Dart-tool folder, android folder, and iOS folder in the build directory. It helps to clear the disk space as even the small apps can consume largely disk space that is nearly 200M. So, It’s always a good idea to run Flutter Clean for those applications.

Image description
__

✨Flutter Run:

The command is used to run the application. However, before running this command make sure you have connected devices to run the app. By default, Flutter runs the debug version of an application with hot reload support.

Image description
__

✨Attach Existing App:

While debugging if you lost communication, then you cannot use the Hot Reload or Hot Restart feature. So, instead of re-building or installing new applications, you can attach existing installed applications.

Image description
__

✨Flutter Install:

Hitting the command installs your applications into the devices and emulators. But before executing the command, you have to create an app bundle or apk or binary files using the flutter build command.

Image description
__

✨Running Test Files:

Test commands are used to test files of flutter apps. This includes testing separate files while developing flutter apps. This may include Widget Test.

Image description
__

✨Code Analysis:

Though your project doesn’t have any errors, It’s essential to analyze your project code or specific files using the following command.

Image description
__

✨Flutter Config:

The command is used to config flutter functionalities that you require in your project. It enables flutter desktop and flutter web support for other platforms which are disabled by default.

Image description
__

✨Bug/Error Report:

The flutter bug report command captures the basic system info relevant to diagnosing developer-reported bugs.

Image description

Top comments (0)