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

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

Issue 10781032: restarting adb server before each testing start will cause conflict for multiple emulators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: delete temp avds when start up Created 8 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 | Annotate | Revision Log
« no previous file with comments | « build/android/emulator.py ('k') | build/android/pylib/single_test_runner.py » ('j') | 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 List of devices attached 77 List of devices attached
78 027c10494100b4d7 device 78 027c10494100b4d7 device
79 emulator-5554 offline 79 emulator-5554 offline
80 emulator-5558 device 80 emulator-5558 device
81 """ 81 """
82 re_device = re.compile('^emulator-[0-9]+', re.MULTILINE) 82 re_device = re.compile('^emulator-[0-9]+', re.MULTILINE)
83 devices = re_device.findall(cmd_helper.GetCmdOutput(['adb', 'devices'])) 83 devices = re_device.findall(cmd_helper.GetCmdOutput(['adb', 'devices']))
84 return devices 84 return devices
85 85
86 86
87 def GetAVDs():
88 """Returns a list of AVDs."""
89 re_avd = re.compile('^[ ]+Name: ([a-zA-Z0-9_:.-]+)', re.MULTILINE)
90 avds = re_avd.findall(cmd_helper.GetCmdOutput(['android', 'list', 'avd']))
91 return avds
92
93
87 def GetAttachedDevices(): 94 def GetAttachedDevices():
88 """Returns a list of attached, online android devices. 95 """Returns a list of attached, online android devices.
89 96
90 If a preferred device has been set with ANDROID_SERIAL, it will be first in 97 If a preferred device has been set with ANDROID_SERIAL, it will be first in
91 the returned list. 98 the returned list.
92 99
93 Example output: 100 Example output:
94 101
95 * daemon not running. starting it now on port 5037 * 102 * daemon not running. starting it now on port 5037 *
96 * daemon started successfully * 103 * daemon started successfully *
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 if len(process_results) <= 8: 945 if len(process_results) <= 8:
939 continue 946 continue
940 # Column 0 is the executable name 947 # Column 0 is the executable name
941 # Column 1 is the pid 948 # Column 1 is the pid
942 # Column 8 is the Inode in use 949 # Column 8 is the Inode in use
943 if process_results[8] == socket_name: 950 if process_results[8] == socket_name:
944 pids.append( (int(process_results[1]), process_results[0]) ) 951 pids.append( (int(process_results[1]), process_results[0]) )
945 break 952 break
946 logging.info('PidsUsingDevicePort: %s', pids) 953 logging.info('PidsUsingDevicePort: %s', pids)
947 return pids 954 return pids
OLDNEW
« no previous file with comments | « build/android/emulator.py ('k') | build/android/pylib/single_test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698