← 返回命令列表

Linux command

flutter 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create new project

flutter create [app_name]

Run app in

flutter run

Build release APK

flutter build apk

Get dependencies

flutter pub get

Run tests

flutter test

说明

flutter is the command-line tool that drives the Flutter UI framework. It scaffolds projects, manages package dependencies through pub, runs builds for each supported platform, and orchestrates the developer loop including hot-reload and hot-restart during flutter run. A single Dart codebase compiles to native binaries for iOS, Android, macOS, Linux, Windows, and to JavaScript/WebAssembly for the web. The doctor subcommand inspects the host machine and reports missing prerequisites such as the Android SDK, Xcode, command-line tools, and the appropriate device emulators. flutter devices lists currently attached or running targets that flutter run can deploy to.

参数

create _NAME_
Create new Flutter project.
run
Run app on device/emulator.
build _TARGET_
Build app (apk, ios, web).
test
Run unit and widget tests.
pub _SUBCMD_
Package management.
doctor
Check environment setup.
devices
List connected devices.
--help
Display help information.

FAQ

What is the flutter command used for?

flutter is the command-line tool that drives the Flutter UI framework. It scaffolds projects, manages package dependencies through pub, runs builds for each supported platform, and orchestrates the developer loop including hot-reload and hot-restart during flutter run. A single Dart codebase compiles to native binaries for iOS, Android, macOS, Linux, Windows, and to JavaScript/WebAssembly for the web. The doctor subcommand inspects the host machine and reports missing prerequisites such as the Android SDK, Xcode, command-line tools, and the appropriate device emulators. flutter devices lists currently attached or running targets that flutter run can deploy to.

How do I run a basic flutter example?

Run `flutter create [app_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does create _NAME_ do in flutter?

Create new Flutter project.