Skip to content

[Bug]: SSH device host with a Homebrew Android SDK lists no devices; emulator -list-avds exit 127 also hides iOS Simulators #17904

Closed

Description

@nerkza

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

  1. 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). Leave ANDROID_HOME unset. Homebrew keeps the SDK in /opt/homebrew/share/android-commandlinetools and links only adb, avdmanager and sdkmanager into /opt/homebrew/bin, so emulator is not on the PATH.
  2. On a Linux T3 server, add the Mac as an SSH device host (deviceHosts in settings).
  3. 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:

  1. apps/server/src/device/sshDeviceScript.ts:137: the probe marks Android available when adb version succeeds.
  2. apps/server/src/device/sshDeviceScript.ts:8-12: ANDROID_HOME is only inferred from ~/Library/Android/sdk or ~/Android/Sdk, so $ANDROID_HOME/emulator never reaches the PATH for a Homebrew SDK. LocalDeviceHost.ts:150-152 derives the SDK root from adb's real path, so a local host would find this SDK; SSH hosts do not.
  3. apps/server/src/device/DeviceService.ts:399-405: fetchDevices runs emulator -list-avds for any Android-capable host and returns a DeviceOperationError when it exits non-zero. That throws away the hub's simulators and emulators as 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 (as LocalDeviceHost does) and export ANDROID_HOME and the PATH from it.
  • Check for emulator as well as adb before reporting Android as available, or give a reason when it is missing.
  • In fetchDevices, do not let a failed emulator -list-avds drop the hub's device list: skip the extra AVDs and put the error in detail.

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

  1. t3dotgg commented on Oct 21, 2026

    @t3dotgg
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions