Table of Contents
This guide contains a list of basic commands that are frequently used while developing flutter apps.
$ flutter --version
//Output
Flutter 1.7.8+hotfix.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 20e59316b8 (5 weeks ago) • 2019-07-18 20:04:33 -0700
Engine • revision fee001c93f
Tools • Dart 2.4.0
$ flutter version v1.9.1+hotfix.3
$ flutter upgrade
//Output
Upgrading Flutter from /home/dev/Desktop/workspace/flutter...
Updating d51fd86cd..20e59316b
19 files changed, 61 insertions(+), 33 deletions(-)
Upgrading engine...
Downloading android-arm-profile/linux-x64 tools... 1.0s
Downloading android-arm-release/linux-x64 tools... 0.6s
Downloading android-arm64-profile/linux-x64 tools... 0.9s
Downloading android-arm64-release/linux-x64 tools... 1.4s
Downloading android-x86 tools... 2.4s
Downloading android-x64 tools... 2.1s
Downloading android-arm tools... 0.9s
Downloading android-arm-profile tools... 0.8s
Downloading android-arm-release tools... 0.5s
Downloading android-arm64 tools... 1.0s
Downloading android-arm64-profile tools... 0.6s
Downloading android-arm64-release tools... 0.5s
Downloading package sky_engine... 0.2s
Downloading common tools... 1.1s
Downloading common tools... 1.1s
Downloading linux-x64 tools... 3.3s
Flutter 1.7.8+hotfix.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 20e59316b8 (5 weeks ago) • 2019-07-18 20:04:33 -0700
Engine • revision fee001c93f
Tools • Dart 2.4.0
Flutter has following channels :
$ flutter channel
//Output
Flutter channels:
* stable
beta
dev
master
symbol * next to the channel name indicates your current channel
Run command - use “flutter channel [channel-name]”
$ flutter channel dev
Using this command we can switch to dev channel
This command that checks your environment and displays report of the status of flutter installation.
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Android Studio (version 3.5)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
$ flutter config --no-analytics
use “flutter create [app-name]”
$ flutter create yourappname
$ flutter install
OR
$ flutter run
Running flutter build defaults to a release build
$ flutter build appbundle
Note : release bundle for your app is created at /build/app/outputs/bundle/release/app.aab
Running flutter build command defaults to a release build
$ flutter build apk
Note : this command builds a fat apk
OR
$ flutter build apk --split-per-abi
Note : the above command generated two apk files