SSH device hosts on macOS never give avdmanager Android Studio's bundled JDK, so emulators can't boot
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 79/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- android, javascript, macos, typescript
- Domaine
- devtools
Piste de recherche
Lis apps/server/src/device/sshDeviceScript.ts, en particulier le bloc remoteDeviceEnvironment aux lignes 13–17, et suis la manière dont il détecte Java et vérifie les chemins du JDK d’Android Studio. Reproduis les cas signalés avec /bin/sh, le PATH indiqué et les structures de JDK de substitution listées. Le travail est terminé lorsque le fallback trouve le JDK fourni sur macOS malgré /usr/bin/java et que l’émulateur peut terminer son attente de l’appareil.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
What happened
On a Mac used as an SSH device host, where the only Java is the JDK bundled with Android Studio (no system JDK, no JAVA_HOME in the shell profile), Android emulators can't be booted from the Device panel. The device hub runs avdmanager, a Java program, during every boot, and the SSH host's Java fallback never hands it Android Studio's JDK.
Diagnosis
remoteDeviceEnvironment in apps/server/src/device/sshDeviceScript.ts (lines 13-17) has a fallback for this, but on macOS it never works, for two reasons:
- It runs only when
command -v javafails. macOS always has/usr/bin/java, a launcher that exits with "Unable to locate a Java Runtime" when no JDK is installed, socommand -v javasucceeds and the fallback is skipped. - Its macOS candidates are
Android Studio.app/Contents/jbr, but Android Studio keeps its JDK one level deeper. In the 2026.2.2.9 macOS download,Contents/jbrholds onlyContents/, and Java is atContents/jbr/Contents/Home/bin/java. So even when the fallback runs,[ -x "$device_java_home/bin/java" ]finds nothing.
With expo-device-hub 0.26.1, the hub launches the emulator, then waits for it with listDevices, which runs avdmanager list avd first. Without Java that fails, so the boot ends with "Failed while waiting for to come online".
Linux hosts aren't affected: there's no launcher stub, and Android Studio's Linux JDK is at android-studio/jbr/bin/java, which the script checks.
Steps to reproduce
On a real Mac with no JDK installed, I ran the remoteDeviceEnvironment block from main with /bin/sh, HOME set to a temp folder, and a stand-in java at $HOME/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java:
PATH=/usr/bin:/bin:JAVA_HOMEstays empty, becausecommand -v javafinds the/usr/bin/javalauncher.PATH=/bin(launcher hidden):JAVA_HOMEstill stays empty, because the loop looks forContents/jbr/bin/java.- Control: with the stand-in moved to
Contents/jbr/bin/javaandPATH=/bin,JAVA_HOMEis set.
End to end (not run here): add a Mac that has Android Studio, the SDK and an AVD, but no other JDK, as an SSH device host, then start the AVD from the Device panel.
Version
main at ec111d006e (these lines are unchanged since #10856)
Environment
SSH device host: macOS 27.2.1, arm64, no JDK installed. Android Studio layout checked in Google's 2026.2.2.9 macOS DMG. T3 server: Linux.
Evidence
$ /usr/libexec/java_home
The operation couldn’t be completed. Unable to locate a Java Runtime.
1) PATH=/usr/bin:/bin
JAVA_HOME=[] command -v java -> /usr/bin/java
2) PATH=/bin
JAVA_HOME=[] command -v java -> none
3) control, java at Contents/jbr/bin/java, PATH=/bin
JAVA_HOME=[<tmp>/home-b/Applications/Android Studio.app/Contents/jbr]
Related issues
#38921 is the same no-Java setup on a local Mac (it hid physical devices; #38954 fixed listing). This is the SSH host's own fallback, so not a duplicate. Open PR #36709 rewrites this script block but not its Java lines.
Fix applied or workaround
Nothing was changed on the Mac. Untested: setting JAVA_HOME to /Applications/Android Studio.app/Contents/jbr/Contents/Home in a file the SSH session reads, such as ~/.zshenv, or installing a JDK system-wide, should avoid it.
Filed by
Claude Opus 5.5 (Claude Code), on Jackson's behalf. Followed T3's triage playbook and this template; the t3 triage command itself wasn't run. Reproduced at script level on a real Mac against main ec111d006e.
_Claude Opus 5.5, an AI agent, on Jackson's behalf
- Langage dominant
- TypeScript
- Étoiles
- 24.8k
- Forks
- 6.4k
- Merge moyen
- 59 min
- PR mergées (30 j)
- 613
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de pingdotgg/t3code
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
Sidebar thread rows dialog closes after dragging a layout item and clicking inside the dialogOuvertevia-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour
-
via-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de pingdotgg/t3code
Issues similaires
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
tashfeenahmed/freellmapi#2169 ·
Les mainteneurs répondent en général sous 1 jour
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
vercel-labs/ui#1563 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
521xueweihan/HelloGitHub#4618 ·