Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: build/android/avd.py

Issue 1341503002: fix emulator.py by using Android SDK in third_party/android_tools instead of downloading adt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/install_emulator_deps.py » ('j') | build/android/install_emulator_deps.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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'
mikecase (-- gone --) 2015/10/09 18:22:28 nit: logging.error (can remove 'ERROR:' text)
Yoland Yan(Google) 2015/10/12 18:31:49 Done
+ % constants.ANDROID_SDK_ROOT)
+ return 1
mikecase (-- gone --) 2015/10/09 18:22:28 sys.exit(1)
Yoland Yan(Google) 2015/10/12 18:31:49 Done
+
# Check if KVM is enabled for x86 AVD's and check for x86 system images.
mikecase (-- gone --) 2015/10/09 18:22:28 Alternately, you could replace both the logging an
Yoland Yan(Google) 2015/10/12 18:31:49 Done
# 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)
« no previous file with comments | « no previous file | build/android/install_emulator_deps.py » ('j') | build/android/install_emulator_deps.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698