| Index: build/android/avd.py
|
| diff --git a/build/android/avd.py b/build/android/avd.py
|
| index 50720ed4016a3c91254854b7ed32183815907d89..03b3a3e891324c320357ab29fc223e6577a000a5 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,14 @@ 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():
|
| + logging.critical('ERROR: Emulator SDK not installed in %s'
|
| + % constants.ANDROID_SDK_ROOT)
|
| + return 1
|
| +
|
| # 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 +61,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)
|
|
|