anthropics / anthropics/claude-code
Desktop app iOS Simulator helper (claude-ios-sim) crash-loops on macOS 27.0: NSInvalidArgumentException in Metal binary archive during CIContext creation
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
# claude-ios-sim crash-loops on macOS 27.0 when capturing the simulator
**Environment**
- Claude desktop app (Code tab), iOS Simulator panel
- macOS 27.0 (26A428), Xcode 27.0 (27A266a), Apple Silicon
- Simulator runtimes iOS 26.3 / 26.4; booted device iPhone 18 Pro Max
**Symptom**
"Attach a simulator" panel shows "Claude Code iOS Simulator is restarting after a crash. Try again in 1s" in a loop.
`control(attach)` succeeds; the first `control(screenshot)` (or the panel's own frame capture) crashes the helper.
16 crash reports between 11:32 and 11:45 local time.
**Crash**
`~/Library/Logs/DiagnosticReports/claude-ios-sim-2026-09-15-114526.ips`
- SIGABRT, uncaught `NSInvalidArgumentException`:
`*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]`
- Last exception backtrace (top → bottom):
```
CoreFoundation -[__NSPlaceholderArray initWithObjects:count:]
Metal __39-[_MTLDevice recordBinaryArchiveUsage:]_block_invoke (dispatch_once)
Metal -[_MTLBinaryArchive loadFromURL:error:]
CoreImage +[CIKernelLibrary(Internal) internalBinaryArchiveWithName:device:]
CoreImage CI::MetalContext::init
CoreImage +[CIContext contextWithMTLDevice:options:]
claude-ios-sim (screenshot / frame pipeline)
```
**Notes**
- Reproduces on every attach; not device-specific (happened after the device set was recreated).
- Headless `xcodebuild` builds/tests on the same simulators work fine; only the panel/screenshot path is affected.
- Likely a macOS 27 Metal/CoreImage regression hit when the helper creates a `CIContext` backed by a Metal device. A software/CPU `CIContext` fallback, or catching the ObjC exception around context creation, would keep the panel usable.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the control(attach) and control(screenshot) paths and the screenshot/frame pipeline where CIContext creation occurs. Reproduce on macOS 27.0 with the listed iOS Simulator setup, then inspect the crash report's Metal/CoreImage trace and compare the available context-creation fallback options. Done means the first screenshot and the panel's frame capture no longer crash-loop the helper.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, macos
- Domain
- computer-graphics, desktop-dev, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100