aboutsummaryrefslogtreecommitdiffstats
path: root/etc/run_in_headless_android_emulator.py
diff options
context:
space:
mode:
authorPaul Rouget <me@paulrouget.com>2018-07-31 22:38:54 +0800
committerPaul Rouget <me@paulrouget.com>2018-07-31 22:39:45 +0800
commitbef2fe83cd995eb291e1ce58c2966b232431a735 (patch)
treee41ff1e02633e59f1e016c493f86781636e47847 /etc/run_in_headless_android_emulator.py
parent76d394eca84b0acdeeabe90f855fa0a2b525d235 (diff)
downloadservo-bef2fe83cd995eb291e1ce58c2966b232431a735.tar.gz
servo-bef2fe83cd995eb291e1ce58c2966b232431a735.zip
new android port: fix android build and tests
Diffstat (limited to 'etc/run_in_headless_android_emulator.py')
-rwxr-xr-xetc/run_in_headless_android_emulator.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/etc/run_in_headless_android_emulator.py b/etc/run_in_headless_android_emulator.py
index af8034b204d..1d2959e4f06 100755
--- a/etc/run_in_headless_android_emulator.py
+++ b/etc/run_in_headless_android_emulator.py
@@ -10,6 +10,7 @@
# except according to those terms.
import contextlib
+import json
import os
import signal
import subprocess
@@ -55,16 +56,17 @@ def main(avd_name, apk_path, *args):
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"],
- stdout=sys.stderr)
+ json_params = shell_quote(json.dumps(args))
+ extra = "-e servoargs " + json_params
+ cmd = "am start " + extra + " com.mozilla.servo/com.mozilla.servo.MainActivity"
+ check_call(adb + ["shell", cmd], stdout=sys.stderr)
# Start showing logs as soon as the application starts,
# in case they say something useful while we wait in subsequent steps.
logcat_args = [
"--format=raw", # Print no metadata, only log messages
- "RustAndroidGlueStdouterr:D", # Show (debug level) Rust stdio
+ "simpleservo:D", # Show (debug level) Rust stdio
"*:S", # Hide everything else
]
with terminate_on_exit(adb + ["logcat"] + logcat_args) as logcat:
@@ -125,16 +127,6 @@ def check_call(*args, **kwargs):
sys.exit(exit_code)
-def write_args(adb, args):
- data_dir = "/sdcard/Android/data/com.mozilla.servo/files"
- params_file = data_dir + "/android_params"
-
- check_call(adb + ["shell", "mkdir -p %s" % data_dir])
- check_call(adb + ["shell", "echo 'servo' > %s" % params_file])
- for arg in args:
- check_call(adb + ["shell", "echo %s >> %s" % (shell_quote(arg), params_file)])
-
-
def write_user_stylesheets(adb, args):
data_dir = "/sdcard/Android/data/com.mozilla.servo/files"
check_call(adb + ["shell", "mkdir -p %s" % data_dir])