OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 from multiprocessing import Process | 7 from multiprocessing import Process |
| 8 import optparse |
8 import os | 9 import os |
| 10 import sys |
9 | 11 |
10 from pylib import android_commands | 12 from pylib import android_commands |
| 13 from pylib import test_options_parser |
11 | 14 |
12 | 15 |
13 def InstallContentShell(device): | 16 def InstallContentShell(device, build_type): |
14 apk_path = os.path.join(os.environ['CHROME_SRC'], | 17 apk_path = os.path.join(os.environ['CHROME_SRC'], |
15 'out/Release/content_shell/ContentShell-debug.apk') | 18 'out', build_type, |
| 19 'content_shell', 'ContentShell-debug.apk') |
16 result = android_commands.AndroidCommands(device=device).ManagedInstall( | 20 result = android_commands.AndroidCommands(device=device).ManagedInstall( |
17 apk_path, False, 'org.chromium.content_shell') | 21 apk_path, False, 'org.chromium.content_shell') |
18 print '----- Installed on %s -----' % device | 22 print '----- Installed on %s -----' % device |
19 print result | 23 print result |
20 | 24 |
21 | 25 |
| 26 parser = optparse.OptionParser() |
| 27 test_options_parser.AddBuildTypeOption(parser) |
| 28 options, args = parser.parse_args(sys.argv) |
| 29 |
22 devices = android_commands.GetAttachedDevices() | 30 devices = android_commands.GetAttachedDevices() |
23 if not devices: | 31 if not devices: |
24 raise Exception('Error: no connected devices') | 32 raise Exception('Error: no connected devices') |
25 | 33 |
26 procs = [] | 34 procs = [] |
27 for device in devices: | 35 for device in devices: |
28 p = Process(target=InstallContentShell, args=(device,)) | 36 p = Process(target=InstallContentShell, args=(device, options.build_type)) |
29 p.start() | 37 p.start() |
30 procs += [p] | 38 procs += [p] |
31 | 39 |
32 for p in procs: | 40 for p in procs: |
33 p.join() | 41 p.join() |
OLD | NEW |