Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#24,900 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@shivamhwp is already working on this.

Since Oct 25, 2026.

  • #24912 by @shivamhwp — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ios, typescript
Domain
desktop, tooling

Research direction

Start by reading apps/server/src/device/deviceToolVersions.json to confirm the pinned expo-device-hub version, then inspect its vendored serve-sim/dist/middleware.js screenshot route and compare it with the canary bundle containing the upstream fix. Update the pin to a stable release that includes the fix; done when screenshot capture succeeds on the iPhone Duo while single-display simulator capture still works.

Written by the indexing model from the issue text.

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
  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.

Dominant language
TypeScript
Stars
24.8k
Forks
6.4k
Avg merge
8h 4m
Merged PRs (30d)
199

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pingdotgg/t3code

All issues in pingdotgg/t3code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.