Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug]: Device screenshot fails with 500 on iPhone Duo (Xcode 27.2): serve-sim calls simctl without --display

Abierto Apto para principiantes
#24,900 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@shivamhwp ya está trabajando en esto.

Desde el 25/10/2026.

  • #24912 de @shivamhwp — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
66/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
ios, typescript
Área
desktop, tooling

Línea de trabajo

Empieza leyendo apps/server/src/device/deviceToolVersions.json para confirmar la versión fijada de expo-device-hub. Luego, inspecciona la ruta de capturas de pantalla de serve-sim/dist/middleware.js incluida en el paquete y compárala con el bundle canary que contiene la corrección upstream. Actualiza la versión fijada a una versión estable que incluya la corrección. El trabajo estará terminado cuando la captura de pantalla funcione en el iPhone Duo y siga funcionando en el simulador con una sola pantalla.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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. With Xcode 27.2, boot an iPhone Duo simulator (iOS 27.2 runtime iOS-27-2-iPhone19-4). Folded or unfolded doesn't matter.
  2. Open it in the T3 Code Device panel.
  3. 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] (current latest): still calls simctl io … screenshot without --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.

Lenguaje dominante
TypeScript
Estrellas
24.8k
Forks
6.4k
Merge medio
4 h 29 min
PR fusionados (30 d)
305

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pingdotgg/t3code

Todos los issues de pingdotgg/t3code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.