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

Side by Side Diff: build/android/pylib/android_commands.py

Issue 19736003: Add a backwards compatible change to GetEmulators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Provides an interface to communicate with the device via the adb command. 5 """Provides an interface to communicate with the device via the adb command.
6 6
7 Assumes adb binary is currently on system path. 7 Assumes adb binary is currently on system path.
8 """ 8 """
9 9
10 import collections 10 import collections
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 MD5SUM_LD_LIBRARY_PATH = 'LD_LIBRARY_PATH=%s' % MD5SUM_DEVICE_FOLDER 66 MD5SUM_LD_LIBRARY_PATH = 'LD_LIBRARY_PATH=%s' % MD5SUM_DEVICE_FOLDER
67 67
68 68
69 def GetAVDs(): 69 def GetAVDs():
70 """Returns a list of AVDs.""" 70 """Returns a list of AVDs."""
71 re_avd = re.compile('^[ ]+Name: ([a-zA-Z0-9_:.-]+)', re.MULTILINE) 71 re_avd = re.compile('^[ ]+Name: ([a-zA-Z0-9_:.-]+)', re.MULTILINE)
72 avds = re_avd.findall(cmd_helper.GetCmdOutput(['android', 'list', 'avd'])) 72 avds = re_avd.findall(cmd_helper.GetCmdOutput(['android', 'list', 'avd']))
73 return avds 73 return avds
74 74
75 75
76 def GetEmulators():
77 """Backwards compatibility call to get emulators.
78
79 Deprecated: use GetAttachedDevices(hardware=False) instead.
80 """
81 return GetAttachedDevices(hardware=False)
82
76 def GetAttachedDevices(hardware=True, emulator=True, offline=False): 83 def GetAttachedDevices(hardware=True, emulator=True, offline=False):
77 """Returns a list of attached, android devices and emulators. 84 """Returns a list of attached, android devices and emulators.
78 85
79 If a preferred device has been set with ANDROID_SERIAL, it will be first in 86 If a preferred device has been set with ANDROID_SERIAL, it will be first in
80 the returned list. The arguments specify what devices to include in the list. 87 the returned list. The arguments specify what devices to include in the list.
81 88
82 Example output: 89 Example output:
83 90
84 * daemon not running. starting it now on port 5037 * 91 * daemon not running. starting it now on port 5037 *
85 * daemon started successfully * 92 * daemon started successfully *
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 """ 1469 """
1463 def __init__(self, output): 1470 def __init__(self, output):
1464 self._output = output 1471 self._output = output
1465 1472
1466 def write(self, data): 1473 def write(self, data):
1467 data = data.replace('\r\r\n', '\n') 1474 data = data.replace('\r\r\n', '\n')
1468 self._output.write(data) 1475 self._output.write(data)
1469 1476
1470 def flush(self): 1477 def flush(self):
1471 self._output.flush() 1478 self._output.flush()
OLDNEW
« 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