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: 8oqyHaGyDHV
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1071,20 +1071,22 @@ class Package(MachCommandBase):
return ret
@CommandProvider
class Install(MachCommandBase):
"""Install a package."""
@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.')
+ 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')
return ret
@CommandProvider
class RunProgram(MachCommandBase):
"""Run the compiled program."""
--- a/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
+++ b/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
@@ -70,33 +70,33 @@ AVD_DICT = {
'testing/config/tooltool-manifests/androidx86/releng.manifest',
['-gpu', 'swiftshader', '-debug',
'init,console,gles,memcheck,adbserver,adbclient,adb,avd_config,socket',
'-qemu', '-m', '1024', '-enable-kvm'],
5554)
}
-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.
If a device is found or an emulator started and 'install' is
specified, also check whether Firefox is installed on the
device; if not, prompt to install Firefox.
If 'xre' is specified, also check with MOZ_HOST_BIN is set
to a valid xre/host-utils directory; if not, prompt to set
one up.
If 'debugger' is specified, also check that JimDB is installed;
if JimDB is not found, prompt to set up JimDB.
Returns True if the emulator was started or another device was
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
elif emulator.is_available():
response = raw_input(
"No Android devices connected. Start an emulator? (Y/n) ").strip()
if response.lower().startswith('y') or response == '':
if not emulator.check_avd():