Skip to content

CarPlay prototypes

CarPlay prototypes are not supported (#14934, epic #14924). The iOS prototype agent draws only on the phone screen: it adds a SwiftUI window inside the target app’s process, which CarPlay never shows, and it refuses a display selector. No CarPlay-specific nodes exist in the spec.

A CarPlay app mostly cannot draw custom UI. The system renders Apple’s templates (CPListTemplate, CPGridTemplate, CPTabBarTemplate, now playing and so on) out of process; only some categories, such as the navigation map base view, get a custom window. Any CarPlay prototype needs a different rendering path.

CarPlay screen power helper

ios/carplay-power (carplay-power-helper <udid> status|power-on [--head-unit-inputs]|tap <x> <y>|input <name> [count]) reports a booted simulator’s screens, makes its TVOut screen the CarPlay car display, taps it, or sends it a head-unit input. It checks private CoreSimulator selectors, waits for callbacks, and re-enumerates to verify power state; unavailable APIs produce actionable errors.

  • power-on writes a StarkConfig to <device data>/Library/Application Support/Simulator/extended_display.plist (800x480 @2x, stark and hasTouchScreen true, the other has* keys false), then sets TVOut’s mode with the HasTouchScreen and Stark CarPlay properties. That powers TVOut on; backboardd makes it the car display and CarPlay’s home screen renders within about 2 s. --head-unit-inputs sets hasBackButton, hasHomeButton, hasWheel and hasWheelBump true as well.
  • Both steps are required. CoreSimulator resets the plist to {"stark":0} on every boot, so run power-on after each boot. Running it again on a projecting screen is harmless.
  • power-on refuses iOS 27 and later runtimes with unsupported-runtime: Apple does not support CarPlay on that simulator. status works on any runtime. The TypeScript side refuses them first: startDevice carPlay, CarPlay tapAt, pressButton and observe read the runtime from simctl list devices (carPlayRuntime.ts) and return the same [unsupported-runtime] error before any helper path or the probe is checked (#19185). An unreadable runtime passes to the helpers.
  • The TypeScript bridge is injectable and uses AUTOMOBILE_CARPLAY_POWER_HELPER_PATH. Its JSON lists every screen and a carPlay object for TVOut: found, nullable screenID and powerState.
  • Capture the car display with xcrun simctl io <udid> screenshot --display=TVOut.

CarPlay touch contract

carplay-power-helper <udid> tap <x> <y> sends one tap to the car screen through SimulatorKit’s Indigo HID messages (SimDeviceLegacyHIDClient, loaded from $DEVELOPER_DIR/Library/PrivateFrameworks/SimulatorKit.framework).

  • The CarPlay touch service is Indigo HID target 1. SimulatorKit uses it for screenType 1 (TVOut) and 2 (Wireless); CarPlayHID.target maps any other type to none. Never send to IndigoHIDTargetForScreen(id) (0x40000000 | id) for a car screen: no virtual service has that target and backboardd aborts on it.
  • Before any HID message the helper re-enumerates the screens and refuses, sending nothing, unless the runtime is iOS 26.x (unsupported-runtime), a TVOut screen exists (no-carplay-screen), and its screenType is 1 or 2 (unsupported-screen-type). It also refuses unless the screen is powered on (carplay-not-powered) and x, y lie inside its pixel size (usage).
  • Each run sends IndigoHIDMessageToCreateCarPlayService(true) before the touch, because CoreSimulator HID state does not survive a reboot; creating it again is harmless. Without the service, touches to target 1 are ignored.
  • The touch is IndigoHIDMessageForMouseNSEvent left mouse down, an 80 ms hold, then up. The message divides the point by the size it is given, so x, y and the size are both the car screen’s pixels (800x480 after power-on), the same pixels as a --display=TVOut screenshot. A failed send is hid-failed. The output is one JSON line, tapped: the point, screenID, screenType, target, width and height.
  • carPlayTap.ts runs it through the same exec seam as power-on. tapCarPlayScreen first requires the projection probe to report the car display, so a screen that is not projecting is refused before the helper runs. In turn, tapAt with display: "carPlay" calls it; phone-only tapAt fields are refused. tapOn has no CarPlay selector because nothing reads the car screen’s hierarchy.

CarPlay head-unit input contract

carplay-power-helper <udid> input <name> [count] sends one head-unit input to the CarPlay service, target 1. No mapping has been run on a simulator yet; see CarPlay head-unit inputs on the simulator.

Input Message StarkConfig key
back IndigoHIDMessageForHIDArbitrary, Consumer 0x224 (AC Back) hasBackButton
home IndigoHIDMessageForHIDArbitrary, Consumer 0x223 (AC Home) hasHomeButton
siri IndigoHIDMessageForHIDArbitrary, Consumer 0xCF (Voice Command) none
knob-select IndigoHIDMessageForHIDArbitrary, Consumer 0x41 (Menu Pick) hasWheel
knob-up, knob-down, knob-left, knob-right IndigoHIDMessageForHIDArbitrary, Consumer 0x42-0x45 (Menu Up, Down, Left, Right) hasWheelBump
knob-cw, knob-ccw IOHIDEventCreateScrollEvent y -1 / +1 per detent through IndigoHIDMessageForScrollEventFromHIDEventRef hasWheel
  • A usage is a press (op 1), an 80 ms hold, then a release (op 2). Rotation sends count events (1-50) 50 ms apart; every other input refuses a count other than 1 with usage.
  • Before sending, the helper runs the touch contract’s checks (runtime, TVOut, screen type, power) and reads extended_display.plist. An input whose key is not true there is refused with head-unit-inputs-disabled. Then it creates the CarPlay service, as for a tap.
  • The output is one JSON line, sent: input, count, screenID, screenType, target, and either usagePage and usage or scrollDelta.
  • carPlayInput.ts runs it through the same exec seam, and sendCarPlayInput requires the projection probe to report the car display first.
  • pressButton with display: "carPlay" maps back, home, siri and the rotary_* buttons to these inputs; steps is the rotation count. It refuses every other button. Any other display refuses siri before the phone path runs.
  • startDevice carPlay.headUnitInputs passes --head-unit-inputs to power-on.

Projection readiness contract

ios/carplay-projection-probe is an arm64 iOS 26.0+ simulator executable, run inside the selected simulator with xcrun simctl spawn <udid> <absolute-probe-path>. Build and ad-hoc sign it with bash ios/carplay-projection-probe/build.sh [output-path]; set AUTOMOBILE_CARPLAY_PROJECTION_PROBE_PATH to the result.

  • It enumerates +[CADisplay displays] and reports one display, preferred in this order: Car tag, CarInstruments tag, AirPlay tag, the display named TVOut, the display whose deviceName is wireless0. On iOS 26.x the car display is TVOut (deviceName PurpleTVOut) and the Wireless display’s deviceName is a UUID.
  • It reads tag, displayType and displayId through typed objc_msgSend casts, and name and deviceName as strings. It never constructs FBSDisplayConfiguration: initializing one for a powered-off, tag-zero display can segfault.
  • Unavailable selectors fail on stderr with a nonzero exit; no matching display is a successful found: false.
  • It arms alarm(10) on start. The host’s 15 s timeout kills xcrun, which does not necessarily end the process spawned inside the simulator; the alarm bounds it either way.
  • scripts/ios/swift-build.sh builds it in the macOS Swift CI job when the iphonesimulator SDK is 26 or later. A unit test checks that both JSON branches in probe.m carry exactly the schema’s keys. Running it needs a booted simulator, so CI does not execute it.

Output is one JSON line: found, nullable tag, displayId, displayType, identity, name and deviceName, and boolean isCarDisplay / isCarInstrumentsDisplay. Missing displays have null metadata and false flags. Car is bit 0x20; instruments is bit 0x40; both flags are computed independently. Identity is seed-free, chosen in priority order: Car[id], CarInstruments[id], AirPlay[id] (bit 0x4), Untagged[id] (tag zero), then Tag0x<hex>[id]. name is the value simctl io --display accepts.

carPlayProjection.ts validates the strict JSON over the injectable exec seam with a 15 s timeout. requireCarPlayProjection probes and refuses capture unless either Car flag is true. Its error names the screen and identity, explains the black frame and gives the recovery step. Attachment and power-on alone are not enough: TVOut stays untagged without the StarkConfig. A positive tag is a readiness signal, not verification of a captured image. Then captureCarPlayScreen runs that check before taking a screenshot and passes the probed displayId (carPlayCaptureDisplay) as simctl io screenshot --display, so a refused or unpowered screen is never captured. Finally, observe({display: "carplay"}) uses the same guard before it selects the single named CarPlay screen and captures its PNG.

Background