mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
fix a regression in adb forward
This commit is contained in:
parent
c7ad846d98
commit
ce9111b591
@ -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 {
|
|||||||
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}'
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user