Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1196)

Unified Diff: tools/profile_chrome/main.py

Issue 944143002: tools/profile_chrome.py -d to select one of multiple connected android devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/profile_chrome/main.py
diff --git a/tools/profile_chrome/main.py b/tools/profile_chrome/main.py
index 7d015e6126fa5981cae2c228315a5eaa876f02b7..0f9f1498e3ecacfa84c22e732d4536d9f2a8f028 100755
--- a/tools/profile_chrome/main.py
+++ b/tools/profile_chrome/main.py
@@ -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']:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698