Commit 5dbb818a authored by benjhayden's avatar benjhayden Committed by Commit bot

tools/profile_chrome.py -d device to select one of multiple connected android devices.

Review URL: https://codereview.chromium.org/944143002

Cr-Commit-Position: refs/heads/master@{#317657}
parent ce3ea567
......@@ -165,10 +165,14 @@ When in doubt, just try out --trace-frame-viewer.
logging.getLogger().setLevel(logging.DEBUG)
devices = android_commands.GetAttachedDevices()
if not options.device and len(devices) != 1:
parser.error('Exactly 1 device must be attached.')
device = device_utils.DeviceUtils(
next((d for d in devices if d == options.device), devices[0]))
device = None
if options.device in devices:
device = options.device
elif not options.device and len(devices) == 1:
device = devices[0]
if not device:
parser.error('Use -d/--device to select a device:\n' + '\n'.join(devices))
device = device_utils.DeviceUtils(device)
package_info = profiler.GetSupportedBrowsers()[options.browser]
if options.chrome_categories in ['list', 'help']:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment