mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Auto merge of #9020 - mbrubeck:mach-run, r=larsbergstrom
Update `mach run` to use android_params file Currently it sets the SERVO_URL variable, which Servo no longer supports. r? @larsbergstrom <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9020) <!-- Reviewable:end -->
This commit is contained in:
commit
2a3a7a73b5
1 changed files with 15 additions and 11 deletions
|
@ -62,17 +62,21 @@ class PostBuildCommands(CommandBase):
|
||||||
print("Android on-device debugging is not supported by mach yet. See")
|
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")
|
print("https://github.com/servo/servo/wiki/Building-for-Android#debugging-on-device")
|
||||||
return
|
return
|
||||||
if params:
|
script = [
|
||||||
url = params[0]
|
"am force-stop com.mozilla.servo",
|
||||||
else:
|
"echo servo >/sdcard/servo/android_params"
|
||||||
url = 'http://mozilla.org/'
|
]
|
||||||
subprocess.Popen(["adb", "shell"], stdin=subprocess.PIPE).communicate('''
|
for param in params:
|
||||||
am force-stop com.mozilla.servo
|
script += [
|
||||||
export SERVO_URL='%s'
|
"echo '%s' >>/sdcard/servo/android_params" % param.replace("'", "\\'")
|
||||||
am start com.mozilla.servo/com.mozilla.servo.MainActivity
|
]
|
||||||
exit
|
script += [
|
||||||
''' % url.replace('\'', '\\\''))
|
"am start com.mozilla.servo/com.mozilla.servo.MainActivity",
|
||||||
return
|
"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)]
|
args = [self.get_binary_path(release, dev)]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue