diff options
author | Matt Brubeck <mbrubeck@limpet.net> | 2015-12-18 10:09:24 -0800 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2015-12-18 10:09:48 -0800 |
commit | d7ba536ad6ffa1a8d0c7c0d4e17f4d31bdac8e08 (patch) | |
tree | b04441c3cf30d64d5cd45c0177f38d33066ccd79 /python/servo/post_build_commands.py | |
parent | 6764cf0ee9ce78d2d3498aec18e633e20455e050 (diff) | |
download | servo-d7ba536ad6ffa1a8d0c7c0d4e17f4d31bdac8e08.tar.gz servo-d7ba536ad6ffa1a8d0c7c0d4e17f4d31bdac8e08.zip |
Update `mach run` to use android_params file
Diffstat (limited to 'python/servo/post_build_commands.py')
-rw-r--r-- | python/servo/post_build_commands.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index 682fae4da25..af290fea111 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -62,17 +62,21 @@ class PostBuildCommands(CommandBase): print("Android on-device debugging is not supported by mach yet. See") print("https://github.com/servo/servo/wiki/Building-for-Android#debugging-on-device") return - if params: - url = params[0] - else: - url = 'http://mozilla.org/' - subprocess.Popen(["adb", "shell"], stdin=subprocess.PIPE).communicate(''' - am force-stop com.mozilla.servo - export SERVO_URL='%s' - am start com.mozilla.servo/com.mozilla.servo.MainActivity - exit - ''' % url.replace('\'', '\\\'')) - return + script = [ + "am force-stop com.mozilla.servo", + "echo servo >/sdcard/servo/android_params" + ] + for param in params: + script += [ + "echo '%s' >>/sdcard/servo/android_params" % param.replace("'", "\\'") + ] + script += [ + "am start com.mozilla.servo/com.mozilla.servo.MainActivity", + "exit" + ] + shell = subprocess.Popen(["adb", "shell"], stdin=subprocess.PIPE) + shell.communicate("\n".join(script) + "\n") + return shell.wait() args = [self.get_binary_path(release, dev)] |