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-onwrites a StarkConfig to<device data>/Library/Application Support/Simulator/extended_display.plist(800x480 @2x,starkandhasTouchScreentrue, the otherhas*keys false), then sets TVOut’s mode with theHasTouchScreenandStarkCarPlay properties. That powers TVOut on; backboardd makes it the car display and CarPlay’s home screen renders within about 2 s.--head-unit-inputssetshasBackButton,hasHomeButton,hasWheelandhasWheelBumptrue as well.- Both steps are required. CoreSimulator resets the plist to
{"stark":0}on every boot, so runpower-onafter each boot. Running it again on a projecting screen is harmless. power-onrefuses iOS 27 and later runtimes withunsupported-runtime: Apple does not support CarPlay on that simulator.statusworks on any runtime. The TypeScript side refuses them first:startDevicecarPlay, CarPlaytapAt,pressButtonandobserveread the runtime fromsimctl 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 acarPlayobject for TVOut:found, nullablescreenIDandpowerState. - 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 screenType1(TVOut) and2(Wireless);CarPlayHID.targetmaps any other type to none. Never send toIndigoHIDTargetForScreen(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
IndigoHIDMessageForMouseNSEventleft 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 afterpower-on), the same pixels as a--display=TVOutscreenshot. A failed send ishid-failed. The output is one JSON line,tapped: the point,screenID,screenType,target,widthandheight. carPlayTap.tsruns it through the same exec seam as power-on.tapCarPlayScreenfirst requires the projection probe to report the car display, so a screen that is not projecting is refused before the helper runs. In turn,tapAtwithdisplay: "carPlay"calls it; phone-onlytapAtfields are refused.tapOnhas 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 (op2). Rotation sendscountevents (1-50) 50 ms apart; every other input refuses a count other than 1 withusage. - 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 withhead-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 eitherusagePageandusageorscrollDelta. carPlayInput.tsruns it through the same exec seam, andsendCarPlayInputrequires the projection probe to report the car display first.pressButtonwithdisplay: "carPlay"mapsback,home,siriand therotary_*buttons to these inputs;stepsis the rotation count. It refuses every other button. Any other display refusessiribefore the phone path runs.startDevicecarPlay.headUnitInputspasses--head-unit-inputsto 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 namedTVOut, the display whosedeviceNameiswireless0. On iOS 26.x the car display is TVOut (deviceNamePurpleTVOut) and the Wireless display’sdeviceNameis a UUID. - It reads
tag,displayTypeanddisplayIdthrough typedobjc_msgSendcasts, andnameanddeviceNameas strings. It never constructsFBSDisplayConfiguration: 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 killsxcrun, which does not necessarily end the process spawned inside the simulator; the alarm bounds it either way. scripts/ios/swift-build.shbuilds it in the macOS Swift CI job when the iphonesimulator SDK is 26 or later. A unit test checks that both JSON branches inprobe.mcarry 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.