XCUITest simulator "Unable to boot device" in CI
Before XCUITest runs, xcodebuild boots the destination simulator through CoreSimulator. On CI this boot is flaky: it can time out, hit a CoreSimulator service error, or fail because the requested device/runtime is not installed on the runner.
What this error means
The test build fails with "Unable to boot the Simulator", "Unable to boot device in current state: Booted", or "The request to open ... failed" during the xcodebuild test destination setup.
Unable to boot device in current state: Booted
Domain: com.apple.CoreSimulator.SimError
xcodebuild: error: Failed to build/test: Simulator device failed to bootCommon causes
Transient CoreSimulator boot failure
A cold macOS runner boots simulators slowly and CoreSimulator can return an error or leave a device stuck, so the destination never comes up.
The destination device or runtime is not installed
The -destination names a simulator model or iOS runtime the runner image does not have, so it cannot boot.
How to fix it
Pre-boot an available destination
- List available simulators with
xcrun simctl list devices available. - Boot one before
xcodebuild testand target it as the destination. - Match the
-destinationOS to an installed runtime.
xcrun simctl boot "iPhone 15"
xcodebuild test -scheme App \
-destination 'platform=iOS Simulator,name=iPhone 15'Reset a wedged CoreSimulator
Shut down and erase stale devices before retrying so a stuck state does not block the boot.
xcrun simctl shutdown all
xcrun simctl erase allHow to prevent it
- Target a simulator device/runtime the runner image provides.
- Pre-boot the destination before
xcodebuild test. - Clear stale simulators between jobs.