Chromium Code Reviews| Index: build/android/avd.py |
| diff --git a/build/android/avd.py b/build/android/avd.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..3754169e660c19ec25cddf3c432b61aff6f9fa0d |
| --- /dev/null |
| +++ b/build/android/avd.py |
| @@ -0,0 +1,50 @@ |
| +#!/usr/bin/env python |
| +# Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +"""Launches Android Virtual Devices with a set configuration for testing Chrome. |
| + |
| +The script will launch a specified number of Android Virtual Devices (AVD's). |
| +""" |
| + |
| + |
| +import logging |
| +import optparse |
| +import os |
| +import subprocess |
| +import sys |
| + |
| +from pylib.utils import emulator |
| + |
| + |
| +def main(argv): |
| + # Run script from parent directory of chrome checkout, where emulator SDK is |
| + # installed by install-emulator-deps.py |
| + new_cwd = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', |
|
frankf
2013/03/27 05:16:08
Declare this in constants.py relative to constants
navabi
2013/03/27 17:13:36
Done.
|
| + '..', '..') |
| + # The location of the SDK used to launch the emulator |
| + emulator_sdk = os.path.join(new_cwd, 'android_tools', 'sdk') |
| + os.environ['ANDROID_SDK_ROOT'] = emulator_sdk |
| + |
| + opt_parser = optparse.OptionParser(description='AVD script.') |
| + opt_parser.add_option('-n', '--num', dest='emulator_count', |
| + help='Number of emulators to launch.', |
| + type='int', default='1') |
| + opt_parser.add_option('--abi', default='arm', |
| + help='Platform of emulators to launch.') |
| + |
| + options, _ = opt_parser.parse_args(argv[1:]) |
| + if options.abi == 'arm': |
| + options.abi = 'armeabi-v7a' |
| + |
| + logging.basicConfig(level=logging.INFO, |
| + format='# %(asctime)-15s: %(message)s') |
| + logging.root.setLevel(logging.INFO) |
| + |
| + emulator.LaunchEmulators(emulator_sdk, options.emulator_count, options.abi, |
| + True) |
| + |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main(sys.argv)) |