From d95f79f95f0f4cd9b6e2a9ec8d3238df82f3fbd8 Mon Sep 17 00:00:00 2001 From: Pragya Date: Thu, 23 Jul 2020 07:01:12 +0530 Subject: [PATCH] Updated instructions of 'flutter help attach' (#61569) --- packages/flutter_tools/doc/attach.md | 2 +- .../flutter_tools/lib/src/commands/attach.dart | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/doc/attach.md b/packages/flutter_tools/doc/attach.md index 0683d68555e..303cb801907 100644 --- a/packages/flutter_tools/doc/attach.md +++ b/packages/flutter_tools/doc/attach.md @@ -7,7 +7,7 @@ without `flutter run` and provides a HotRunner (enabling hot reload/restart). ## Usage -There are four ways for the attach command to discover a running app: +There are three ways for the attach command to discover a running app: 1. If the platform is Fuchsia the module name must be provided, e.g. `$ flutter attach --module=mod_name`. This can be called either before or after diff --git a/packages/flutter_tools/lib/src/commands/attach.dart b/packages/flutter_tools/lib/src/commands/attach.dart index 00cfaac0c49..167ef0332bb 100644 --- a/packages/flutter_tools/lib/src/commands/attach.dart +++ b/packages/flutter_tools/lib/src/commands/attach.dart @@ -111,7 +111,20 @@ class AttachCommand extends FlutterCommand { final String name = 'attach'; @override - final String description = 'Attach to a running application.'; + final String description = '''Attach to a running application. + + For attaching to Android or iOS devices, simply using `flutter attach` is + usually sufficient. The tool will search for a running Flutter app or module, + if available. Otherwise, the tool will wait for the next Flutter app or module + to launch before attaching. + + For Fuchsia, the module name must be provided, e.g. `\$flutter attach + --module=mod_name`. This can be called either before or after the application + is started. + + If the app or module is already running and the specific observatory port is + known, it can be explicitly provided to attach via the command-line, e.g. + `\$ flutter attach --debug-port 12345`'''; int get debugPort { if (argResults['debug-port'] == null) {