xcrun simctl boot: Start an iOS Simulator in CI
xcrun simctl boot <udid> starts an iOS Simulator device; simctl list shows the available runtimes and device UDIDs to boot.
On a macOS CI runner you drive Simulators through xcrun simctl. The two operations that gate everything else are finding the right device UDID with list and booting it, ideally waiting for bootstatus before you install.
What it does
xcrun simctl is the command-line control for the iOS/tvOS/watchOS Simulator. list enumerates runtimes, device types, and existing devices with their UDIDs and states; boot starts a device; bootstatus waits until it is fully booted; shutdown stops it.
Common usage
xcrun simctl list devices available
# boot by UDID (or by name for a unique device)
xcrun simctl boot "iPhone 15"
# block until fully booted
xcrun simctl bootstatus "iPhone 15" -b
xcrun simctl shutdown allOptions
| Subcommand / flag | What it does |
|---|---|
| list [devices|runtimes] | List devices, runtimes, or device types |
| boot <udid|name> | Boot the given simulator |
| bootstatus <udid> -b | Wait for boot to finish (-b also boots) |
| shutdown <udid|all> | Shut down one or all devices |
| -j | Emit list output as JSON for scripting |
In CI
Boot the simulator once and reuse it across the test run rather than letting xcodebuild cold-boot per action. Use xcrun simctl list devices available -j and parse the JSON to pick a device that matches the installed runtime, since exact iOS versions differ between Xcode images.
Common errors in CI
"Unable to boot device in current state: Booted" just means it is already booted (safe to ignore). "Unable to boot device because we cannot determine the runtime bundle" or "Invalid device state" points at a stale CoreSimulator; run xcrun simctl shutdown all then xcrun simctl erase all. "Unable to find a device matching..." means the device name/runtime is not installed in this Xcode; check simctl list.