$npx -y skills add dpearson2699/swift-ios-skills --skill carplayBuild CarPlay-enabled apps using the CarPlay framework. Use when creating navigation, audio, communication, EV charging, parking, or food ordering apps for the car display, working with CPTemplateApplicationScene, CPInterfaceController template hierarchies, CPListTemplate, CPMapT
| 1 | # CarPlay |
| 2 | |
| 3 | Build category-entitled, template-based CarPlay apps for the vehicle display. |
| 4 | Scope: Swift 6.3, iOS 26+. |
| 5 | |
| 6 | See [references/carplay-patterns.md](references/carplay-patterns.md) for extended patterns including full |
| 7 | navigation sessions, dashboard scenes, and advanced template composition. |
| 8 | |
| 9 | Scope boundary: full CarPlay framework apps use category entitlements, |
| 10 | `CPTemplateApplicationScene`, `CPTemplateApplicationSceneDelegate`, |
| 11 | `CPInterfaceController`, and system `CPTemplate` navigation. CarPlay-visible |
| 12 | WidgetKit widgets and ActivityKit Live Activities are separate system |
| 13 | experiences; route their implementation to those domains while keeping |
| 14 | CarPlay-specific validation here. |
| 15 | |
| 16 | ## Contents |
| 17 | |
| 18 | - [Entitlements and Setup](#entitlements-and-setup) |
| 19 | - [Scene Configuration](#scene-configuration) |
| 20 | - [Templates Overview](#templates-overview) |
| 21 | - [Navigation Apps](#navigation-apps) |
| 22 | - [Audio Apps](#audio-apps) |
| 23 | - [Communication Apps](#communication-apps) |
| 24 | - [Point of Interest Apps](#point-of-interest-apps) |
| 25 | - [Testing with CarPlay Simulator](#testing-with-carplay-simulator) |
| 26 | - [Common Mistakes](#common-mistakes) |
| 27 | - [Review Checklist](#review-checklist) |
| 28 | - [References](#references) |
| 29 | |
| 30 | ## Entitlements and Setup |
| 31 | |
| 32 | Request the category-specific entitlement from |
| 33 | [Apple's CarPlay entitlement form](https://developer.apple.com/contact/carplay), |
| 34 | accept the addendum, then provision the approved category key below. |
| 35 | |
| 36 | ### Entitlement Keys by Category |
| 37 | |
| 38 | | Entitlement | Category | |
| 39 | |---|---| |
| 40 | | `com.apple.developer.carplay-audio` | Audio | |
| 41 | | `com.apple.developer.carplay-communication` | Communication | |
| 42 | | `com.apple.developer.carplay-maps` | Navigation | |
| 43 | | `com.apple.developer.carplay-charging` | EV Charging | |
| 44 | | `com.apple.developer.carplay-parking` | Parking | |
| 45 | | `com.apple.developer.carplay-quick-ordering` | Quick Food Ordering | |
| 46 | |
| 47 | ### Project Configuration |
| 48 | |
| 49 | 1. Update the App ID in the developer portal under Additional Capabilities. |
| 50 | 2. Generate a new provisioning profile for the updated App ID. |
| 51 | 3. In Xcode, disable automatic signing and import the CarPlay provisioning profile. |
| 52 | 4. Add an `Entitlements.plist` with the entitlement key set to `true`. |
| 53 | 5. Set Code Signing Entitlements build setting to the `Entitlements.plist` path. |
| 54 | |
| 55 | ### Key Types |
| 56 | |
| 57 | | Type | Role | |
| 58 | |---|---| |
| 59 | | `CPTemplateApplicationScene` | UIScene subclass for the CarPlay display | |
| 60 | | `CPTemplateApplicationSceneDelegate` | Scene connect/disconnect lifecycle | |
| 61 | | `CPInterfaceController` | CarPlay-provided controller for setting the root template and pushing, presenting, or popping templates | |
| 62 | | `CPTemplate` | Abstract base for all CarPlay templates | |
| 63 | | `CPSessionConfiguration` | Vehicle display limits and content style | |
| 64 | |
| 65 | ## Scene Configuration |
| 66 | |
| 67 | Declare the CarPlay scene in `Info.plist` and implement |
| 68 | `CPTemplateApplicationSceneDelegate` to respond when CarPlay connects. |
| 69 | |
| 70 | ### Info.plist Scene Manifest |
| 71 | |
| 72 | ```plist |
| 73 | <key>UIApplicationSceneManifest</key> |
| 74 | <dict> |
| 75 | <key>UIApplicationSupportsMultipleScenes</key> |
| 76 | <true/> |
| 77 | <key>UISceneConfigurations</key> |
| 78 | <dict> |
| 79 | <key>CPTemplateApplicationSceneSessionRoleApplication</key> |
| 80 | <array> |
| 81 | <dict> |
| 82 | <key>UISceneClassName</key> |
| 83 | <string>CPTemplateApplicationScene</string> |
| 84 | <key>UISceneConfigurationName</key> |
| 85 | <string>CarPlaySceneConfiguration</string> |
| 86 | <key>UISceneDelegateClassName</key> |
| 87 | <string>$(PRODUCT_MODULE_NAME).CarPlaySceneDelegate</string> |
| 88 | </dict> |
| 89 | </array> |
| 90 | </dict> |
| 91 | </dict> |
| 92 | ``` |
| 93 | |
| 94 | ### Scene Delegate (Non-Navigation) |
| 95 | |
| 96 | Non-navigation apps receive an interface controller only. No window. |
| 97 | |
| 98 | ```swift |
| 99 | import CarPlay |
| 100 | |
| 101 | final class CarPlaySceneDelegate: UIResponder, |
| 102 | CPTemplateApplicationSceneDelegate { |
| 103 | |
| 104 | var interfaceController: CPInterfaceController? |
| 105 | |
| 106 | func templateApplicationScene( |
| 107 | _ templateApplicationScene: CPTemplateApplicationScene, |
| 108 | didConnect interfaceController: CPInterfaceController |
| 109 | ) { |
| 110 | self.interfaceController = interfaceController |
| 111 | interfaceController.setRootTemplate(buildRootTemplate(), |
| 112 | animated: true, completion: nil) |
| 113 | } |
| 114 | |
| 115 | func templateApplicationScene( |
| 116 | _ templateApplicationScene: CPTemplateApplicationScene, |
| 117 | didDisconnectInterfaceController interfaceController: CPInterfaceController |
| 118 | ) { |
| 119 | self.interfaceController = nil |
| 120 | } |
| 121 | } |
| 122 | ``` |
| 123 | |
| 124 | ### Scene Delegate (Navigation) |
| 125 | |
| 126 | Navigation apps receive both an interface controller and a `CPWindow`. |
| 127 | Set the window's root view c |