aboutsummaryrefslogtreecommitdiffstats
path: root/etc/run_in_headless_android_emulator.py
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-07-26 09:50:29 +0200
committerSimon Sapin <simon.sapin@exyr.org>2018-07-26 15:36:46 +0200
commit4306336a5b94125befe90cee4b3fa59720c542d7 (patch)
tree99660c963ea42216994df431dbc2cae5cfd6090d /etc/run_in_headless_android_emulator.py
parent65df9cb73a26db2c61100ee8f1ecd13c6a80e225 (diff)
downloadservo-4306336a5b94125befe90cee4b3fa59720c542d7.tar.gz
servo-4306336a5b94125befe90cee4b3fa59720c542d7.zip
run_in_headless_android_emulator: add support for $HOST_FILE
Diffstat (limited to 'etc/run_in_headless_android_emulator.py')
-rwxr-xr-xetc/run_in_headless_android_emulator.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/etc/run_in_headless_android_emulator.py b/etc/run_in_headless_android_emulator.py
index 32f8e18146f..af8034b204d 100755
--- a/etc/run_in_headless_android_emulator.py
+++ b/etc/run_in_headless_android_emulator.py
@@ -54,6 +54,7 @@ def main(avd_name, apk_path, *args):
check_call(adb + ["install", "-r", apk_path])
args = list(args)
write_user_stylesheets(adb, args)
+ write_hosts_file(adb)
write_args(adb, args)
check_call(adb + ["shell", "am start com.mozilla.servo/com.mozilla.servo.MainActivity"],
@@ -143,6 +144,15 @@ def write_user_stylesheets(adb, args):
check_call(adb + ["push", path, remote_path], stdout=sys.stderr)
+def write_hosts_file(adb):
+ hosts_file = os.environ.get("HOST_FILE")
+ if hosts_file:
+ data_dir = "/sdcard/Android/data/com.mozilla.servo/files"
+ check_call(adb + ["shell", "mkdir -p %s" % data_dir])
+ remote_path = data_dir + "/android_hosts"
+ check_call(adb + ["push", hosts_file, remote_path], stdout=sys.stderr)
+
+
def forward_webdriver(adb, args):
webdriver_port = extract_arg("--webdriver", args)
if webdriver_port is not None: