Important Flutter CLI Commands Cheat Sheet.
Tags: flutter, programming, beginners, dart
Published: 2022-07-31 09:17:30

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g64xdgcjvjdh8znlmtut.png)
__

## ✨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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/za0imisvpwk91uwmrr5l.png)
__

## ✨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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/48qb1h25nda3gtgcqr1b.png)
__

## ✨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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40sqgytrpaxqgtj5obob.png)
__

## ✨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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxdfycunx7w6vezr83id.png)
__

## ✨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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iudhsy9qq2ab9r869vl7.png)
__

## ✨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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cnhnyn5uh54qixslyyes.png)
__

## ✨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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9c2fcl6yyazno4f6rtqa.png)
__

## ✨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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jxq52mg1dj2ghs5i5zqf.png)
__

## ✨Bug/Error Report:

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bwonfnba51o9v2apfw69.png)