blob: 247f9ae057ec53b45c712f1f0e2177eaf908c5bb [file] [log] [blame] [view]
Christopher Fujinoeaf058d2019-04-19 08:50:30 -07001# Flutter Attach
2
3## Overview
4
5A Flutter-command that attaches to applications that have been launched
6without `flutter run` and provides a HotRunner (enabling hot reload/restart).
7
8## Usage
9
Pragyad95f79f2020-07-23 07:01:12 +053010There are three ways for the attach command to discover a running app:
Christopher Fujinoeaf058d2019-04-19 08:50:30 -070011
Christopher Fujinoeaf058d2019-04-19 08:50:30 -0700121. If the platform is Fuchsia the module name must be provided, e.g. `$
13flutter attach --module=mod_name`. This can be called either before or after
14the application is started, attach will poll the device if it cannot
15immediately discover the port
xster13767462020-03-25 16:45:49 -0700161. On Android and iOS, just running `flutter attach` suffices. Flutter tools
17will search for an already running Flutter app or module if available.
18Otherwise, the tool will wait for the next Flutter app or module to launch
19before attaching.
Ben Konyiecd75182023-02-28 11:57:04 -0500201. If the app or module is already running and the specific VM Service port is
xster13767462020-03-25 16:45:49 -070021known, it can be explicitly provided to attach via the command-line, e.g.
22`$ flutter attach --debug-port 12345`
Christopher Fujinoeaf058d2019-04-19 08:50:30 -070023
24## Source
25
Pierre-Louis072b8872024-04-17 09:44:23 +020026See the [source](https://github.com/flutter/flutter/blob/main/packages/flutter_tools/lib/src/commands/attach.dart) for the attach command.