AFAIK,当您运行以下命令时,它会在调试模式下运行应用程序。
flutter run
但是下面的命令也做同样的事情。那么,这两个命令有什么区别吗?
flutter run -d
答案 0 :(得分:2)
-d
允许您指定运行目标,例如flutter run -d web
或 flutter run -d linux
$ flutter run linux
Target file "linux" not found.
$ flutter run -d linux
Launching lib/main.dart on Linux in debug mode...
Building Linux application...
$ flutter run --help
Run your Flutter app on an attached device.
Global options:
-d, --device-id Target device id or name (prefixes allowed).
Command(没有 linux
的 -d
部分)默认是一个 --target
标志:
-t, --target=<path> The main entry-point file of the application, as run on the device.
If the --target option is omitted, but a file name is provided on the command line, then that is used instead.
(defaults to "lib/main.dart")