Forward the fixed flutter observatory port in `android_shell.py`.

Fixes https://github.com/domokit/devtools/issues/57 .

R=tonyg@chromium.org

Review URL: https://codereview.chromium.org/1524103002 .

Cr-Mirrored-From: https://github.com/domokit/mojo
Cr-Mirrored-Commit: d2b6d2ebe9b9c21532411300e05c0fee22aaa618
diff --git a/devtoolslib/android_shell.py b/devtoolslib/android_shell.py
index dfa0c84..ca7d5c1 100644
--- a/devtoolslib/android_shell.py
+++ b/devtoolslib/android_shell.py
@@ -34,6 +34,9 @@
 # Used to parse the output of `adb devices`.
 _ADB_DEVICES_HEADER = 'List of devices attached'
 
+# Fixed port on which Flutter observatory is run.
+_FLUTTER_OBSERVATORY_PORT = 8181
+
 
 _logger = logging.getLogger()
 
@@ -398,6 +401,11 @@
     logcat_watch_thread.daemon = True
     logcat_watch_thread.start()
 
+  def forward_flutter_observatory_port(self):
+    """Forwards the fixed port on which Flutter observatory is run."""
+    self._forward_host_port_to_device(_FLUTTER_OBSERVATORY_PORT,
+                                      _FLUTTER_OBSERVATORY_PORT)
+
   @overrides(Shell)
   def serve_local_directories(self, mappings, port, reuse_servers=False):
     assert mappings
@@ -418,6 +426,7 @@
   def run(self, arguments):
     self.clean_logs()
     self.forward_observatory_ports()
+    self.forward_flutter_observatory_port()
 
     p = self.show_logs()
     self.start_shell(arguments, sys.stdout, p.terminate)
diff --git a/remote_adb_setup b/remote_adb_setup
index aa67d6f..4ecd48c 100755
--- a/remote_adb_setup
+++ b/remote_adb_setup
@@ -42,12 +42,14 @@
 # Forward various ports from the remote host to the local host:
 #   5037: adb
 # and from the local host to the remote host:
-#   9998: http server for Sky
+#   8181: Flutter observatory
+#   9998: http server for Flutter
 #   31839: http server for https://core.mojoapps.io
 #   31840: http server for the local mojo: origin
 #   31841: http server for base mappings
 ssh -C \
     -R 5037:127.0.0.1:5037 \
+    -L 8181:127.0.0.1:8181 \
     -L 9998:127.0.0.1:9998 \
     -L 31839:127.0.0.1:31839 \
     -L 31840:127.0.0.1:31840 \