aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/package_commands.py
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-06-25 18:50:15 +0200
committerSimon Sapin <simon.sapin@exyr.org>2018-07-02 13:25:44 +0200
commit4cbf3dea054469c03551b19afc8a819dc52a453e (patch)
tree012dedabfed0999405322307a32ab450de593667 /python/servo/package_commands.py
parentfe24816d12f348b5328386557d3e67b896ec2f4d (diff)
downloadservo-4cbf3dea054469c03551b19afc8a819dc52a453e.tar.gz
servo-4cbf3dea054469c03551b19afc8a819dc52a453e.zip
mach {package,install} --android: add --emulator and --usb
Diffstat (limited to 'python/servo/package_commands.py')
-rw-r--r--python/servo/package_commands.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py
index 5f0e3494279..296f25cd00e 100644
--- a/python/servo/package_commands.py
+++ b/python/servo/package_commands.py
@@ -389,10 +389,16 @@ class PackageCommands(CommandBase):
@CommandArgument('--android',
action='store_true',
help='Install on Android')
+ @CommandArgument('--emulator',
+ action='store_true',
+ help='For Android, intall to the only emulated device')
+ @CommandArgument('--usb',
+ action='store_true',
+ help='For Android, intall to the only USB device')
@CommandArgument('--target', '-t',
default=None,
help='Install the given target platform')
- def install(self, release=False, dev=False, android=False, target=None):
+ def install(self, release=False, dev=False, android=False, emulator=False, usb=False, target=None):
env = self.build_env()
if target and android:
print("Please specify either --target or --android.")
@@ -416,7 +422,15 @@ class PackageCommands(CommandBase):
if android:
pkg_path = binary_path + ".apk"
- exec_command = [self.android_adb_path(env), "install", "-r", pkg_path]
+ exec_command = [self.android_adb_path(env)]
+ if emulator and usb:
+ print("Cannot install to both emulator and USB at the same time.")
+ return 1
+ if emulator:
+ exec_command += ["-e"]
+ if usb:
+ exec_command += ["-d"]
+ exec_command += ["install", "-r", pkg_path]
elif is_windows():
pkg_path = path.join(path.dirname(binary_path), 'msi', 'Servo.msi')
exec_command = ["msiexec", "/i", pkg_path]