Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- On a Mac device host with Xcode and iOS Simulators, install the Android SDK with Homebrew:
brew install --cask android-commandlinetools(plus the emulator package and an AVD). LeaveANDROID_HOMEunset. Homebrew keeps the SDK in/opt/homebrew/share/android-commandlinetoolsand links onlyadb,avdmanagerandsdkmanagerinto/opt/homebrew/bin, soemulatoris not on the PATH. - On a Linux T3 server, add the Mac as an SSH device host (
deviceHostsin settings). - Run
device_list, or open the Device panel for that host.
A Mac with adb on the PATH and no emulator at all hits the same path.
Expected behavior
- The host's iOS Simulators are listed whatever happens on the Android side.
- The SSH host finds the Android SDK the same way the local host does (from
adb's real path), so the Homebrew emulator and its AVDs are listed too.
Actual behavior
The host status is failed with Device list failed: The device command failed (exit code 127). and no devices are listed. On my host this hid 18 iOS Simulators and one Android AVD.
Cause, checked on main at 61eb4af:
apps/server/src/device/sshDeviceScript.ts:137: the probe marks Android available whenadb versionsucceeds.apps/server/src/device/sshDeviceScript.ts:8-12:ANDROID_HOMEis only inferred from~/Library/Android/sdkor~/Android/Sdk, so$ANDROID_HOME/emulatornever reaches the PATH for a Homebrew SDK.LocalDeviceHost.ts:150-152derives the SDK root fromadb's real path, so a local host would find this SDK; SSH hosts do not.apps/server/src/device/DeviceService.ts:399-405:fetchDevicesrunsemulator -list-avdsfor any Android-capable host and returns aDeviceOperationErrorwhen it exits non-zero. That throws away the hub'ssimulatorsandemulatorsas well.
The hub on that host also reports [android-utils] Failed to run \avdmanager list avd`, because without ANDROID_HOMEit looks in~/Library/Android/sdk`.
Possible fixes:
- On SSH hosts, resolve the SDK root from
adb's real path (asLocalDeviceHostdoes) and exportANDROID_HOMEand the PATH from it. - Check for
emulatoras well asadbbefore reporting Android as available, or give a reason when it is missing. - In
fetchDevices, do not let a failedemulator -list-avdsdrop the hub's device list: skip the extra AVDs and put the error indetail.
Workaround: a stub emulator on the SSH PATH (for example ~/.local/bin/emulator that exits 0 for -list-avds) brings the iOS Simulators back. Setting ANDROID_HOME where non-interactive SSH commands see it should also work, because the script keeps an existing ANDROID_HOME.
Impact
Blocks work completely
Version or commit
Server 0.0.46-nightly.20261009.2886; the code paths above are unchanged on main at 61eb4af
Environment
T3 server: Debian 12 x86_64, headless systemd user service. Device host: macOS 27.0.1 (arm64), Xcode 27.0 (27A266a), Node 22.23.2, Homebrew android-commandlinetools with ANDROID_HOME unset. expo-device-hub 0.12.0, agent-device 0.21.12.
Logs or stack traces
DeviceService.fetchDevices Failure DeviceOperationError: Device list failed: The device command failed (exit code 127).
device_list before the workaround (trimmed):
{"hostStatuses":{"macbook":{"status":"failed","detail":"Device list failed: The device command failed (exit code 127)."}},"devices":[]}With a stub emulator on the PATH, the same host reports "status":"ready" with detail [android-utils] Failed to run \avdmanager list avd`:` and lists all 18 iOS Simulators.
Screenshots, recordings, or supporting files
No response
Activity
t3dotgg commentedon Oct 21, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for the report. One part of this is fixed on main in #19974. Please test on the nightly built from main on 2026-10-21, or on the next stable release. One part is still open: SSH discovery still misses the Homebrew SDK and its Android AVDs. If that part still matters to you, please open a new issue for that part only.