Add "./mach android-emulator"

This commit is contained in:
Simon Sapin 2018-06-28 16:40:07 +02:00
parent fc77db4b09
commit b6b9fe07e2
2 changed files with 15 additions and 1 deletions

View file

@ -69,7 +69,7 @@ class MachCommands(CommandBase):
sdk_build_tools = "25.0.2" sdk_build_tools = "25.0.2"
emulator_images = [ emulator_images = [
("servo-armv7", "25", "google_apis;armeabi-v7a"), ("servo-arm", "25", "google_apis;armeabi-v7a"),
("servo-x86", "28", "google_apis;x86"), ("servo-x86", "28", "google_apis;x86"),
] ]

View file

@ -169,6 +169,20 @@ class PostBuildCommands(CommandBase):
else: else:
raise e raise e
@Command('android-emulator',
description='Run the Android emulator',
category='post-build')
@CommandArgument(
'args', nargs='...',
help="Command-line arguments to be passed through to the emulator")
def android_emulator(self, args=None):
if not args:
print("Pass at least an AVD name such as @servo-arm or @servo-x86")
return 1
env = self.build_env()
emulator = path.join(env["ANDROID_SDK"], "emulator", "emulator")
check_call([emulator] + args)
@Command('rr-record', @Command('rr-record',
description='Run Servo whilst recording execution with rr', description='Run Servo whilst recording execution with rr',
category='post-build') category='post-build')