mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
run_in_headless_android_emulator: add support for reverse port forwarding
This commit is contained in:
parent
d7495a2297
commit
94d1acbcfd
2 changed files with 14 additions and 0 deletions
|
@ -139,6 +139,14 @@ def forward_webdriver(adb, args):
|
|||
check_call(adb + ["forward", port, port])
|
||||
sys.stderr.write("Forwarding WebDriver port %s to the emulator\n" % webdriver_port)
|
||||
|
||||
split = os.environ.get("EMULATOR_REVERSE_FORWARD_PORTS", "").split(",")
|
||||
ports = [int(part) for part in split if part]
|
||||
for port in ports:
|
||||
port = "tcp:%s" % port
|
||||
check_call(adb + ["reverse", port, port])
|
||||
if ports:
|
||||
sys.stderr.write("Reverse-forwarding ports %s\n" % ", ".join(map(str, ports)))
|
||||
|
||||
|
||||
def extract_arg(name, args):
|
||||
for _, arg in extract_args(name, args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue