Fix build/android/enable_asserts.py.
The script seems to have been broken in https://codereview.chromium.org/221823011 (missing device serial when creating DeviceUtils). This fixes the script by iterating over all connected devices. BUG=267773 Review URL: https://codereview.chromium.org/249533002 git-svn-id: http://src.chromium.org/svn/trunk/src/build@265770 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
Родитель
6bb24afc91
Коммит
038eb1b410
|
@ -6,6 +6,7 @@
|
|||
|
||||
"""Enables dalvik vm asserts in the android device."""
|
||||
|
||||
from pylib import android_commands
|
||||
from pylib.device import device_utils
|
||||
import optparse
|
||||
import sys
|
||||
|
@ -21,10 +22,13 @@ def main(argv):
|
|||
help='Removes the dalvik.vm.enableassertions property')
|
||||
options, _ = option_parser.parse_args(argv)
|
||||
|
||||
device = device_utils.DeviceUtils()
|
||||
if options.set_asserts != None:
|
||||
if device.old_interface.SetJavaAssertsEnabled(options.set_asserts):
|
||||
device.old_interface.Reboot(full_reboot=False)
|
||||
# TODO(jbudorick): Accept optional serial number and run only for the
|
||||
# specified device when present.
|
||||
devices = android_commands.GetAttachedDevices()
|
||||
for device in [device_utils.DeviceUtils(serial) for serial in devices]:
|
||||
if options.set_asserts != None:
|
||||
if device.old_interface.SetJavaAssertsEnabled(options.set_asserts):
|
||||
device.old_interface.Reboot(full_reboot=False)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Загрузка…
Ссылка в новой задаче