flutter attach

Attach to a running app

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
-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
--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
--device-user <seconds>Identifier number for a user or work profile on Android only. Run "adb shell pm list users" for available identifiers
--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
--debug-uriThe URI at which the observatory is listening
--app-idThe package name (Android) or bundle identifier (iOS) for the app. This can be specified to avoid being prompted if multiple observatory ports are advertised. If you have multiple devices or emulators running, you should include the device hostname as well, e.g. "com.example.myApp@my-iphone". This parameter is case-insensitive
--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
--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)
--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
--device-timeout <seconds>Time in seconds to wait for devices to attach. Longer timeouts may be necessary for networked devices