Bug 1310215 - Add a verbose argument to mach install which provides useful information in case the android emulator startup fails. r=ahal

MozReview-Commit-ID: EhuBgeewqtb
This commit is contained in:
Kartikaya Gupta 2016-10-14 11:15:10 -04:00
parent 95aec74c11
commit f6d49dac63
2 changed files with 6 additions and 4 deletions

View File

@ -1076,10 +1076,12 @@ class Install(MachCommandBase):
@Command('install', category='post-build',
description='Install the package on the machine, or on a device.')
def install(self):
@CommandArgument('--verbose', '-v', action='store_true',
help='Print verbose output when installing to an Android emulator.')
def install(self, verbose=False):
if conditions.is_android(self):
from mozrunner.devices.android_device import verify_android_device
verify_android_device(self)
verify_android_device(self, verbose=verbose)
ret = self._run_make(directory=".", target='install', ensure_exit_code=False)
if ret == 0:
self.notify('Install complete')

View File

@ -75,7 +75,7 @@ AVD_DICT = {
}
def verify_android_device(build_obj, install=False, xre=False, debugger=False):
def verify_android_device(build_obj, install=False, xre=False, debugger=False, verbose=False):
"""
Determine if any Android device is connected via adb.
If no device is found, prompt to start an emulator.
@ -91,7 +91,7 @@ def verify_android_device(build_obj, install=False, xre=False, debugger=False):
already connected.
"""
device_verified = False
emulator = AndroidEmulator('*', substs=build_obj.substs)
emulator = AndroidEmulator('*', substs=build_obj.substs, verbose=verbose)
devices = emulator.dm.devices()
if (len(devices) > 0) and ('device' in [d[1] for d in devices]):
device_verified = True