Skip to content

Instantly share code, notes, and snippets.

@rahulkhatri19
Last active August 23, 2022 05:14
Show Gist options
  • Save rahulkhatri19/6e706aa14ed8084e3d94c0ec1da4530f to your computer and use it in GitHub Desktop.
Save rahulkhatri19/6e706aa14ed8084e3d94c0ec1da4530f to your computer and use it in GitHub Desktop.
Basic Flutter Commands

Basic Flutter Commands

Run flutter project :

$ flutter run // if only one device

$ flutter run -d device_name // when more than one device // device name is first bullet.

Eg. $ flutter run More than one device connected; please specify a device with the '-d ' flag, or use '-d all' to act on all devices.

Redmi 3S • a52fd4097d43 • android-arm64 • Android 6.0.1 (API 23) Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

$ flutter run -d a52fd4097d43

$ flutter run --fast-start // debug your apps faster by quickly bootstrap applications on // Android devices if you are using dev/master channel.

flutter create project :

$ flutter create project_name // flutter create calculator_app

$ flutter pub get // after adding a package.

load avd by cmd :

emulator -avd avd_name

list of avd :

emulator -list-avds

emulator -avd Pixel_2_API_28

Flutter update SDK

$ flutter upgrade

Flutter change sdk branch/channel

// Flutter has four release channels: stable, beta, dev, and master. // It's recommended to use the stable channel unless you need a more recent release.

$ flutter channel channel_name

Add Desktop support to Existing project

update flutter package to latest. Then use command.

$ flutter create --platforms=windows,macos,linux .

If org error then use this way. $ flutter create --platforms=windows --org=app_package_name .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment