From b55288b02ded5609ab0e46de942890181fd81168 Mon Sep 17 00:00:00 2001 From: Jeena Date: Mon, 19 Oct 2026 13:38:52 +0000 Subject: [PATCH] emu: prefer the working host SDK over the broken home install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The emulator in ~/Android/Sdk auto-updated to 37.2.12 on Oct 11 and since then consistently fails its own KVM probe ("/dev/kvm is not found") and segfaults on that failure path — while KVM is healthy: a manual KVM_GET_API_VERSION ioctl returns the current API level 12, and both /opt/android-sdk and the container-home emulator pass -accel-check on the same kernel and device node. The script now prefers the documented host SDK at /opt/android-sdk when no ANDROID_SDK_ROOT is set. Once the home SDK is repaired (or the emulator regression disappears), the fallback order can be revisited. Co-Authored-By: Claude --- scripts/start-emulator.sh | 8 ++++++++ 1 file changed, 8 insertions(+) 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"