| 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 import multiprocessing | 7 import multiprocessing |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| 11 | 11 |
| 12 from pylib import android_commands | 12 from pylib import android_commands |
| 13 from pylib import constants | 13 from pylib import constants |
| 14 from pylib.utils import apk_info | 14 from pylib.instrumentation import apk_info |
| 15 from pylib.utils import test_options_parser | 15 from pylib.utils import test_options_parser |
| 16 | 16 |
| 17 | 17 |
| 18 def _InstallApk(args): | 18 def _InstallApk(args): |
| 19 apk_path, apk_package, device = args | 19 apk_path, apk_package, device = args |
| 20 result = android_commands.AndroidCommands(device=device).ManagedInstall( | 20 result = android_commands.AndroidCommands(device=device).ManagedInstall( |
| 21 apk_path, False, apk_package) | 21 apk_path, False, apk_package) |
| 22 print '----- Installed on %s -----' % device | 22 print '----- Installed on %s -----' % device |
| 23 print result | 23 print result |
| 24 | 24 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 pool = multiprocessing.Pool(len(devices)) | 41 pool = multiprocessing.Pool(len(devices)) |
| 42 # Send a tuple (apk_path, apk_package, device) per device. | 42 # Send a tuple (apk_path, apk_package, device) per device. |
| 43 pool.map(_InstallApk, zip([options.apk] * len(devices), | 43 pool.map(_InstallApk, zip([options.apk] * len(devices), |
| 44 [options.apk_package] * len(devices), | 44 [options.apk_package] * len(devices), |
| 45 devices)) | 45 devices)) |
| 46 | 46 |
| 47 | 47 |
| 48 if __name__ == '__main__': | 48 if __name__ == '__main__': |
| 49 sys.exit(main(sys.argv)) | 49 sys.exit(main(sys.argv)) |
| OLD | NEW |