flutter run

Run your Flutter app on an attached device

Options

NameDescription
-h, --helpPrint this usage information
-v, --verboseNoisy logging, including all shell commands executed. If used with --help, shows hidden options
-d, --device-id <device id>Target device id or name (prefixes allowed)
--suppress-analyticsSuppress analytics reporting when this command runs
--debugBuild a debug version of your app (default mode)
--profileBuild a version of your app specialized for performance profiling
--releaseBuild a release version of your app
--dart-define <foo=bar>Additional key-value pairs that will be available as constants from the String.fromEnvironment, bool.fromEnvironment, int.fromEnvironment, and double.fromEnvironment constructors
--flavorBuild a custom app flavor as defined by platform-specific build setup. Supports the use of product flavors in Android Gradle scripts, and the use of custom Xcode schemes
--web-rendererThe renderer implementation to use when building for the web. Possible values are: html - always use the HTML renderer. This renderer uses a combination of HTML, CSS, SVG, 2D Canvas, and WebGL. This is the default. canvaskit - always use the CanvasKit renderer. This renderer uses WebGL and WebAssembly to render graphics. auto - use the HTML renderer on mobile devices, and CanvasKit on desktop devices. [auto (default), canvaskit, html]
--trace-startupTrace application startup, then exit, saving the trace to a file
--verbose-system-logsInclude verbose logging from the flutter engine
--cache-skslOnly cache the shader in SkSL instead of binary or GLSL
--dump-skp-on-shader-compilationAutomatically dump the skp that triggers new shader compilations. This is useful for writing custom ShaderWarmUp to reduce jank. By default, this is not enabled to reduce the overhead. This is only available in profile or debug build
--purge-persistent-cacheRemoves all existing persistent caches. This allows reproducing shader compilation jank that normally only happens the first time an app is run, or for reliable testing of compilation jank fixes (e.g. shader warm-up)
--routeWhich route to load when running the app
--vmservice-out-file <.txt output file path>A file to write the attached vmservice uri to after an application is started. e.g. project/example/out.txt
--use-application-binary <file path to .apk>Specify a pre-built application binary to use when running. For android applications, this must be the path to an APK. For iOS applications, the path to an IPA. Other device types do not yet support prebuilt application binaries. e.g. path/to/app.apk
--endless-trace-bufferEnable tracing to the endless tracer. This is useful when recording huge amounts of traces. If we need to use endless buffer to record startup traces, we can combine the ("--trace-startup"). For example, flutter run --trace-startup --endless-trace-buffer
--trace-systraceEnable tracing to the system tracer. This is only useful on platforms where such a tracer is available (Android and Fuchsia)
--trace-skiaEnable tracing of Skia code. This is useful when debugging the raster thread (formerly known as the GPU thread). By default, Flutter will not log skia code
-a, --dart-entrypoint-args
  • Repeatable ♾
-t, --target <.dart file 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")
--observatory-port(deprecated use host-vmservice-port instead) Listen to the given port for an observatory debugger connection. Specifying port 0 (the default) will find a random free port
--device-vmservice-portLook for vmservice connections only from the specified port. Specifying port 0 (the default) will accept the first vmservice discovered
--host-vmservice-portWhen a device-side vmservice port is forwarded to a host-side port, use this value as the host port. Specifying port 0 (the default) will find a random free host port
--pubRun 'flutter pub get' before executing this command
--no-pubDon't run 'flutter pub get' before executing this command
--track-widget-creationTrack widget creation locations. This enables features such as the widget inspector. This parameter is only functional in debug mode (i.e. when compiling JIT, not AOT)
--no-track-widget-creationNo tracking widget creation locations. This disables features such as the widget inspector. This parameter is only functional in debug mode (i.e. when compiling JIT, not AOT)
--null-assertionsPerform additional null assertions on the boundaries of migrated and un-migrated code. This setting is not currently supported on desktop devices
--no-null-assertionsNot performing additional null assertions on the boundaries of migrated and un-migrated code. This setting is not currently supported on desktop devices
--device-user <seconds>Identifier number for a user or work profile on Android only. Run "adb shell pm list users" for available identifiers
--device-timeout <seconds>Time in seconds to wait for devices to attach. Longer timeouts may be necessary for networked devices
--dds-portWhen this value is provided, the Dart Development Service (DDS) will be bound to the provided port. Specifying port 0 (the default) will find a random free port
--devtools-server-addressWhen this value is provided, the Flutter tool will not spin up a new DevTools server instance, but instead will use the one provided at this address
--enable-software-renderingEnable rendering using the Skia software backend. This is useful when testing Flutter on emulators. By default, Flutter will attempt to either use OpenGL or Vulkan and fall back to software when neither is available
--skia-deterministic-renderingWhen combined with --enable-software-rendering, provides 100% deterministic Skia rendering
--await-first-frame-when-tracingWhether to wait for the first frame when tracing startup ("--trace-startup"), or just dump the trace as soon as the application is running. The first frame is detected by looking for a Timeline event with the name "Rasterized first useful frame". By default, the widgets library's binding takes care of sending this event
--no-await-first-frame-when-tracing
--use-test-fontsEnable (and default to) the "Ahem" font. This is a special font used in tests to remove any dependencies on the font metrics. It is enabled when you use "flutter test". Set this flag when running a test using "flutter run" for debugging purposes. This flag is only available when running in debug mode
--no-use-test-fonts
--build(Deprecated) Build the app before running. To use an existing app, pass the --use-application-binary flag with an existing APK (defaults to on)
--no-build
--pid-fileSpecify a file to write the process id to. You can send SIGUSR1 to trigger a hot reload and SIGUSR2 to trigger a hot restart
--fast-startWhether to quickly bootstrap applications with a minimal app. Currently this is only supported on Android devices. This option cannot be paired with --use-application-binary
--no-fast-start