Commit ce9111b5 authored by Devon Carew's avatar Devon Carew

fix a regression in adb forward

parent c7ad846d
...@@ -549,12 +549,9 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder { ...@@ -549,12 +549,9 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
List<ForwardedPort> get forwardedPorts { List<ForwardedPort> get forwardedPorts {
final List<ForwardedPort> ports = <ForwardedPort>[]; final List<ForwardedPort> ports = <ForwardedPort>[];
String stdout = runCheckedSync( String stdout = runCheckedSync(device.adbCommandForDevice(
<String>[ <String>['forward', '--list']
androidSdk.adbPath, ));
'forward',
'--list'
]);
List<String> lines = LineSplitter.split(stdout).toList(); List<String> lines = LineSplitter.split(stdout).toList();
for (String line in lines) { for (String line in lines) {
...@@ -586,24 +583,16 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder { ...@@ -586,24 +583,16 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
hostPort = await findAvailablePort(); hostPort = await findAvailablePort();
} }
runCheckedSync( runCheckedSync(device.adbCommandForDevice(
<String>[ <String>['forward', 'tcp:$hostPort', 'tcp:$devicePort']
androidSdk.adbPath, ));
'forward',
'tcp:$hostPort',
'tcp:$devicePort',
]);
return hostPort; return hostPort;
} }
Future unforward(ForwardedPort forwardedPort) async { Future unforward(ForwardedPort forwardedPort) async {
runCheckedSync( runCheckedSync(device.adbCommandForDevice(
<String>[ <String>['forward', '--remove', 'tcp:${forwardedPort.hostPort}']
androidSdk.adbPath, ));
'forward',
'--remove',
'tcp:${forwardedPort.hostPort}'
]);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment