diff --git a/scripts/start-emulator.sh b/scripts/start-emulator.sh index ca36d46..a4a81d7 100755 --- a/scripts/start-emulator.sh +++ b/scripts/start-emulator.sh @@ -15,6 +15,14 @@ set -euo pipefail SDK="${ANDROID_SDK_ROOT:-$HOME/Android/Sdk}" +# Prefer the working host SDK at /opt/android-sdk: the emulator that +# ~/Android/Sdk auto-updated to on Oct 11 (37.2.12) fails its own KVM probe +# ("/dev/kvm is not found") with KVM perfectly healthy — /opt/android-sdk and +# the container-home copy both pass -accel-check on the same kernel, so that +# install is broken. /opt/android-sdk is the documented host SDK anyway. +if [ -z "${ANDROID_SDK_ROOT:-}" ] && [ -x /opt/android-sdk/emulator/emulator ]; then + SDK=/opt/android-sdk +fi EMU="$SDK/emulator/emulator" ADB="$SDK/platform-tools/adb" SDKM="$SDK/cmdline-tools/latest/bin/sdkmanager"