Bug 1409624 - Cannot detect valid emulator command when using Android Tools 26. r?nalexander draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 18 Oct 2017 14:01:28 +0900
changeset 682125 73a84a89a056e9e8ec616fba2632befd5572faa6
parent 681956 f78d5947333422ab09ec23e3dab0d48538c9d6ad
child 736307 8b90cf147825d9d00a8c81cffc803ed3f8e2ca99
push id85009
push userbmo:m_kato@ga2.so-net.ne.jp
push dateWed, 18 Oct 2017 05:05:42 +0000
reviewersnalexander
bugs1409624
milestone58.0a1
Bug 1409624 - Cannot detect valid emulator command when using Android Tools 26. r?nalexander Although there is emulator command in android_sdk_root/tools even if Android Tools 26, it doesn't work well becasue emulator64-arm is missing in same directory. Valild emulator command moves from android_sdk_root/tools to android_sdk_root/emulator from Android Tools 26 (updated by sdkmanager). MozReview-Commit-ID: 4IGHK3YcZXD
build/autoconf/android.m4
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -258,19 +258,26 @@ case "$target" in
     android_tools="$android_sdk_root"/tools
     AC_MSG_CHECKING([for Android tools])
     if test -d "$android_tools" -a -f "$android_tools/emulator"; then
         AC_MSG_RESULT([$android_tools])
     else
         AC_MSG_ERROR([You must install the Android tools.  Try |mach bootstrap|.  (Looked for $android_tools)])
     fi
 
-    MOZ_PATH_PROG(EMULATOR, emulator, :, [$android_tools])
+    dnl Android Tools 26 changes emulator path.
+    dnl Although android_sdk_root/tools still has emulator command,
+    dnl it doesn't work correctly
+    MOZ_PATH_PROG(EMULATOR, emulator, :, [$android_sdk_root/emulator])
     if test -z "$EMULATOR" -o "$EMULATOR" = ":"; then
-      AC_MSG_ERROR([The program emulator was not found.  Try |mach bootstrap|.])
+        dnl old emulator path until Android Tools 25.x
+        MOZ_PATH_PROG(EMULATOR, emulator, :, [$android_tools])
+        if test -z "$EMULATOR" -o "$EMULATOR" = ":"; then
+            AC_MSG_ERROR([The program emulator was not found.  Try |mach bootstrap|.])
+        fi
     fi
 
     # `compileSdkVersion ANDROID_COMPILE_SDK_VERSION` is Gradle-only,
     # so there's no associated configure check.
     ANDROID_COMPILE_SDK_VERSION=$1
     ANDROID_TARGET_SDK="${android_target_sdk}"
     ANDROID_SDK="${android_sdk}"
     ANDROID_SDK_ROOT="${android_sdk_root}"