Repository navigation
Description
What happened
With ANDROID_HOME set to the parent of the real SDK directory (<parent> instead of <parent>/sdk), the Device panel reported "Android SDK Platform-Tools are missing from <parent>", and Android was unavailable. The real SDK was at <parent>/sdk, and its platform-tools was on PATH. T3 never tried ANDROID_SDK_ROOT, the default locations, or adb on PATH.
Diagnosis
apps/server/src/device/LocalDeviceHost.ts (v0.1.10, unchanged on main), androidSdk:
const explicit = environment.ANDROID_HOME?.trim() || environment.ANDROID_SDK_ROOT?.trim();
...
if (!explicit && !adb && !emulator) return null; // inspect() accepts any explicit root
...
const candidates = explicit ? [explicit] : [ ...default locations ];
...
if (!explicit) { /* PATH adb lookup */ }- When either env var is set, it is the only candidate.
ANDROID_SDK_ROOTis ignored wheneverANDROID_HOMEis non-empty. inspectreturns a result for an explicit root even when it has neitheradbnoremulator, so detection stops there.- The default locations and the
PATHlookup are both skipped while an explicit value exists.
platformReason then reports Platform-Tools as missing from the wrong root. deviceHostEnvironment also exports that wrong root as ANDROID_HOME to the device hub.
The repo already handles this case the right way elsewhere: scripts/mobile-native-client.ts androidSdk walks [ANDROID_HOME, ANDROID_SDK_ROOT, ...defaults] and takes the first one that has platform-tools.
Steps to reproduce
- Install an Android SDK at
<parent>/sdk(with platform-tools, emulator, and cmdline-tools/latest). - Set
ANDROID_HOME=<parent>(a directory that is not the SDK root), and put<parent>/sdk/platform-toolsonPATH. - Start the T3 Code desktop app and open the Device panel (or call
device_list). - Android is unavailable: "Android SDK Platform-Tools are missing from
<parent>. Install them in Android Studio's SDK Manager."
Expected: T3 tries the candidates in order (ANDROID_HOME, ANDROID_SDK_ROOT, default locations, adb/emulator on PATH) and uses the first root that has adb or emulator. It reports a missing-component reason only when no candidate qualifies. That reason could name the explicit root, plus a note that the env var looks wrong.
Optional: an Android SDK path setting in the app, so users don't depend on login-shell env vars for the desktop app.
Version
T3 Code 0.1.10 (desktop app; local server reports serverVersion 0.1.10). Triage CLI: 0.1.10.
Environment
Linux x64 (CachyOS, kernel 7.3.4), desktop app (AUR-style install under /opt/t3code-bin), local server, Node v26.13.1.
Evidence
- User-reported message: `Android SDK Platform-Tools are missing from <parent>`.
- Source: `apps/server/src/device/LocalDeviceHost.ts` lines 129–176 at tag v0.1.10. `main` has the same logic (`explicit ? [explicit] : …`, `if (!explicit) { PATH lookup }`).
- After `ANDROID_HOME` was corrected to the SDK dir, the running server's env has `ANDROID_HOME` = `ANDROID_SDK_ROOT` = the real SDK. That SDK contains `platform-tools/adb`, `emulator/emulator`, and `cmdline-tools/latest/bin/avdmanager`.Related issues
- [Bug]: Local device host picks the Homebrew adb cask folder as the Android SDK root, so the emulator and AVDs are not found #30617 (closed): the same
androidSdkfunction picks the wrong root through the PATH fallback (Homebrew adb cask). It is a different trigger, but has the same "first acceptable root wins without checking it is a full SDK" theme. - [Bug]: SSH device host with a Homebrew Android SDK lists no devices;
emulator -list-avdsexit 127 also hides iOS Simulators #17904 (closed): the SSH-host side.remoteDeviceEnvironmentinsshDeviceScript.tshas the same pattern: a setANDROID_HOMEis never re-validated or replaced by a fallback.
Fix applied or workaround
Workaround: set ANDROID_HOME (and/or ANDROID_SDK_ROOT) to the actual SDK directory, then restart the desktop app. Or unset both and let auto-detection find adb on PATH.
Filed by
Triaged with Claude Code (Claude Opus 5.5, claude-opus-5-5) via t3 triage
Activity