macOS runner: "Unable to boot device because it cannot be located on disk" in CI
A test or simctl command asked to boot a simulator by UDID, but CoreSimulator has no device with that identifier. The device set changed (image upgrade, deleted device, or wrong runtime), so the UDID is stale.
What this error means
An xcodebuild test or simctl boot fails with "Unable to boot device because it cannot be located on disk. (DTDeviceKit ...)" or "Invalid device: <UDID>".
Unable to boot device because it cannot be located on disk.
The device "iPhone 15" (UDID 1234ABCD-...) could not be located.Common causes
A hard-coded UDID no longer exists
UDIDs differ across runner images and runtimes. A UDID captured on one image is not present on another, so boot fails.
The requested device was deleted or never created
The named device is not in the current device set, so CoreSimulator cannot locate it on disk.
How to fix it
Resolve the device by name at runtime
- List available devices with
xcrun simctl list devices available. - Pick a device name and runtime that exist on this runner.
- Boot by name or create one, instead of a hard-coded UDID.
xcrun simctl list devices available
xcrun simctl boot "iPhone 15"Create a fresh device for the test
Create a device against an installed runtime, then boot it, so the UDID is guaranteed to exist.
UDID=$(xcrun simctl create ci-iphone "iPhone 15" "com.apple.CoreSimulator.SimRuntime.iOS-17-5")
xcrun simctl boot "$UDID"How to prevent it
- Resolve simulators by name and runtime at runtime, not by UDID.
- List available devices before selecting one.
- Create the device in the job rather than reusing a captured UDID.