flutter attach
Attach to a running app
Options
Name | Description |
---|---|
-h, --help | Print this usage information |
-v, --verbose | Noisy 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-analytics | Suppress analytics reporting when this command runs |
--debug | Build a debug version of your app (default mode) |
--profile | Build 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-port | Look for vmservice connections only from the specified port. Specifying port 0 (the default) will accept the first vmservice discovered |
--host-vmservice-port | When 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-assertions | Perform additional null assertions on the boundaries of migrated and un-migrated code. This setting is not currently supported on desktop devices |
--no-null-assertions | Not performing additional null assertions on the boundaries of migrated and un-migrated code. This setting is not currently supported on desktop devices |
--debug-uri | The URI at which the observatory is listening |
--app-id | The 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-file | Specify 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-creation | Track 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-creation | No 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-port | When 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-address | When 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 |