[Bug]: Device screenshot fails with 500 on iPhone Duo (Xcode 27.2): serve-sim calls simctl without --display
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 66/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- ios, typescript
Direzione di ricerca
Inizia leggendo apps/server/src/device/deviceToolVersions.json per confermare la versione bloccata di expo-device-hub, poi esamina la route per gli screenshot di serve-sim/dist/middleware.js fornito con il pacchetto e confrontala con il bundle canary che contiene la correzione upstream. Aggiorna la versione bloccata a una release stabile che includa la correzione. Il lavoro è completato quando l’acquisizione di screenshot funziona su iPhone Duo e continua a funzionare sul simulatore con un solo display.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- With Xcode 27.2, boot an iPhone Duo simulator (iOS 27.2 runtime
iOS-27-2-iPhone19-4). Folded or unfolded doesn't matter. - Open it in the T3 Code Device panel.
- Click the camera (screenshot) button in the device toolbar.
Expected behavior
You get a PNG of the panel currently showing: the cover display (1398×2034) when folded, or the inner display (2007×2853) when unfolded.
Actual behavior
The panel shows "Screenshot capture failed (500). Try again." It fails every time.
The proxy forwards POST /api/device-hub/vendor/serve-sim/api/screenshot?device=<udid> to the vendored serve-sim. serve-sim returns 500 because xcrun simctl io <udid> screenshot <file> exits with code 22:
Cannot choose between 2 displays. Specify one with --display:
--display=3 LCD-1 (primary-1) 2007x2853
--display=1 LCD (primary) 1398x2034
Invalid argument
Cause: The pinned [email protected] (apps/server/src/device/deviceToolVersions.json) runs the simctl screenshot without --display. In its vendored serve-sim/dist/middleware.js, the /api/screenshot route calls:
B6("xcrun", ["simctl", "io", y, "screenshot", b], { timeout: 5000 }, ...)
This matches expo/expo-device-hub#441. On Xcode 27.1, simctl defaulted to the inner panel, so a folded Duo gave an all-black image. On Xcode 27.2, simctl refuses to pick a display on two-display devices, so the capture fails outright.
Suggested fix
Upstream fixed this in expo/expo-device-hub#384 and #388 (merged 2026-10-23, 706806e). /api/screenshot and screenshot.capture now pass --display=<active panel>. I checked the published tarballs:
[email protected](currentlatest): still callssimctl io … screenshotwithout--display.[email protected]: includes the fix:["simctl","io",$.udid,"screenshot",...(_===void 0?[]:[`--display=${_}`]),$.file]
Suggested change: bump expo-device-hub in apps/server/src/device/deviceToolVersions.json to the first stable release that includes expo#384/#388 (presumably 0.19.0) once it's published. Nothing in T3 needs to change for single-display devices, since upstream only adds --display when a panel is selected.
What I could not check: I haven't run T3 against the canary. I confirmed the fix by reading the canary bundle and by running simctl by hand (see Workaround).
Related, but a separate problem: #24033, where device_screenshot drops the failure reason. Here the UI only showed "500". The simctl message above came from calling the hub directly.
Impact
Major degradation or frequent failure
Version or commit
T3 Code Nightly 0.1.3-nightly.20261025.3669 (Electron 44.9.3, Chrome 152.0.7977.167); expo-device-hub 0.15.3 (pinned), agent-device 0.21.25
Environment
macOS 27.0 (26A428), Xcode 27.2 (27B48), simulator iPhone Duo (com.apple.CoreSimulator.SimDeviceType.iPhone-Duo) on runtime iOS 27.2 (24B91014, com.apple.CoreSimulator.SimRuntime.iOS-27-2-iPhone19-4)
Logs or stack traces
# server.trace.ndjson (wsTicket redacted)
POST http://127.0.0.1:3773/api/device-hub/vendor/serve-sim/api/screenshot?device=6D680333-…&hostId=local -> 500
HttpClientError: StatusCode error (500 POST http://127.0.0.1:<hub>/vendor/serve-sim/api/screenshot?device=6D680333-…)
# Direct call to the hub
$ curl -s -X POST "http://127.0.0.1:<hub>/vendor/serve-sim/api/screenshot?device=<udid>"
{"ok":false,"error":"Detected file type from extension: PNG\nAn error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):\nCannot choose between 2 displays. Specify one with --display:\n --display=3 LCD-1 (primary-1) 2007x2853\n --display=1 LCD (primary) 1398x2034\nInvalid argument"}
Workaround
Capture from the terminal and name the display:
xcrun simctl io <udid> screenshot --display=1 folded.png # cover
xcrun simctl io <udid> screenshot --display=3 unfolded.png # inner
Both commands succeed on the same device. Single-display simulators aren't affected.
- Lingua principale
- TypeScript
- Stelle
- 24.8k
- Fork
- 6.4k
- Merge medio
- 2h 48m
- PR unite (30g)
- 353
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pingdotgg/t3code
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Diff line counts use Indian numeral grouping on en_IN locale (inconsistent toLocaleString calls)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pingdotgg/t3code
Issue simili
-
category::task code priority::normal
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
e0ipso/strikethroo#145 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
cocos/cocos-docs#3333 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
RevenueCat/react-native-purchases#2079 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
RevenueCat/purchases-hybrid-common#2039 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-reported area/react bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno