Bug 1203627 - Change search order for finding android emulator; r=ahal
authorGeoff Brown <gbrown@mozilla.com>
Mon, 14 Sep 2015 08:40:34 -0600
changeset 294928 ce840d7632babd00f8a2d8081ac27a06e9c99a51
parent 294927 fe70add404858840b24f81d522033959e95b5f53
child 294929 b89b4f875debe615c069a0109311570ae7774aa6
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1203627
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1203627 - Change search order for finding android emulator; r=ahal
testing/mozbase/mozrunner/mozrunner/devices/android_device.py
--- a/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
+++ b/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
@@ -466,57 +466,60 @@ class AndroidEmulator(object):
         if tools:
             subdir = 'tools'
             var = 'ANDROID_TOOLS'
         else:
             subdir = 'platform-tools'
             var = 'ANDROID_PLATFORM_TOOLS'
 
         found = False
-        # Is exe on PATH?
-        exe_path = find_executable(exe)
-        if exe_path:
-            found = True
-        else:
-            self._log_debug("Unable to find executable on PATH")
 
-        if not found:
-            # Can exe be found in the Android SDK?
-            try:
-                android_sdk_root = os.environ['ANDROID_SDK_ROOT']
-                exe_path = os.path.join(
-                    android_sdk_root, subdir, exe)
-                if os.path.exists(exe_path):
-                    found = True
-                else:
-                    self._log_debug(
-                        "Unable to find executable at %s" % exe_path)
-            except KeyError:
-                self._log_debug("ANDROID_SDK_ROOT not set")
+        # Can exe be found in the Android SDK?
+        try:
+            android_sdk_root = os.environ['ANDROID_SDK_ROOT']
+            exe_path = os.path.join(
+                android_sdk_root, subdir, exe)
+            if os.path.exists(exe_path):
+                found = True
+            else:
+                self._log_debug(
+                    "Unable to find executable at %s" % exe_path)
+        except KeyError:
+            self._log_debug("ANDROID_SDK_ROOT not set")
 
         if not found and self.substs:
             # Can exe be found in ANDROID_TOOLS/ANDROID_PLATFORM_TOOLS?
             try:
                 exe_path = os.path.join(
                     self.substs[var], exe)
                 if os.path.exists(exe_path):
                     found = True
                 else:
                     self._log_debug(
                         "Unable to find executable at %s" % exe_path)
             except KeyError:
                 self._log_debug("%s not set" % var)
 
         if not found:
             # Can exe be found in the default bootstrap location?
+            mozbuild_path = os.environ.get('MOZBUILD_STATE_PATH',
+                os.path.expanduser(os.path.join('~', '.mozbuild')))
             exe_path = os.path.join(
-                '~', '.mozbuild', 'android-sdk-linux', subdir, exe)
+                mozbuild_path, 'android-sdk-linux', subdir, exe)
             if os.path.exists(exe_path):
                 found = True
             else:
                 self._log_debug(
                     "Unable to find executable at %s" % exe_path)
 
+        if not found:
+            # Is exe on PATH?
+            exe_path = find_executable(exe)
+            if exe_path:
+                found = True
+            else:
+                self._log_debug("Unable to find executable on PATH")
+
         if found:
             self._log_debug("%s found at %s" % (exe, exe_path))
         else:
             exe_path = None
         return exe_path