diff options
author | yolandyan <yolandyan@google.com> | 2015-10-13 16:37:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-13 23:37:48 +0000 |
commit | 778ff470b7022b5e0244a471d5041586aaf2b5b6 (patch) | |
tree | 7bac6805ca83bcf6c68db35ae236f8148a8cbe8b /build/android/avd.py | |
parent | a5275edf46616615c96e1ef161597885d5ded51b (diff) | |
download | chromium_src-778ff470b7022b5e0244a471d5041586aaf2b5b6.zip chromium_src-778ff470b7022b5e0244a471d5041586aaf2b5b6.tar.gz chromium_src-778ff470b7022b5e0244a471d5041586aaf2b5b6.tar.bz2 |
fix emulator.py by using Android SDK in third_party/android_tools instead of downloading adt
BUG=
Review URL: https://codereview.chromium.org/1341503002
Cr-Commit-Position: refs/heads/master@{#353903}
Diffstat (limited to 'build/android/avd.py')
-rwxr-xr-x | build/android/avd.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/build/android/avd.py b/build/android/avd.py index 50720ed..65c7eac 100755 --- a/build/android/avd.py +++ b/build/android/avd.py @@ -20,11 +20,10 @@ from devil.utils import cmd_helper from pylib import constants from pylib.utils import emulator - def main(argv): # ANDROID_SDK_ROOT needs to be set to the location of the SDK used to launch # the emulator to find the system images upon launch. - emulator_sdk = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk') + emulator_sdk = constants.ANDROID_SDK_ROOT os.environ['ANDROID_SDK_ROOT'] = emulator_sdk opt_parser = optparse.OptionParser(description='AVD script.') @@ -41,10 +40,13 @@ def main(argv): options, _ = opt_parser.parse_args(argv[1:]) - logging.basicConfig(level=logging.INFO, - format='# %(asctime)-15s: %(message)s') logging.root.setLevel(logging.INFO) + # Check if SDK exist in ANDROID_SDK_ROOT + if not install_emulator_deps.CheckSDK(): + raise Exception('Emulator SDK not installed in %s' + % constants.ANDROID_SDK_ROOT) + # Check if KVM is enabled for x86 AVD's and check for x86 system images. # TODO(andrewhayden) Since we can fix all of these with install_emulator_deps # why don't we just run it? @@ -58,16 +60,11 @@ def main(argv): 'install_emulator_deps.py') return 1 - if not install_emulator_deps.CheckSDK(): - logging.critical('ERROR: Emulator SDK not installed. Run ' - 'install_emulator_deps.py.') - return 1 - # If AVD is specified, check that the SDK has the required target. If not, # check that the SDK has the desired target for the temporary AVD's. api_level = options.api_level if options.name: - android = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk', 'tools', + android = os.path.join(constants.ANDROID_SDK_ROOT, 'tools', 'android') avds_output = cmd_helper.GetCmdOutput([android, 'list', 'avd']) names = re.findall(r'Name: (\w+)', avds_output) |