Support CarPlay in your app.
You add CarPlay support to your existing navigation app. When the user connects their device to a CarPlay-enabled vehicle, CarPlay searches the device for navigation-enabled apps and displays the apps it finds on the CarPlay dashboard.
CarPlay navigation apps must function within the parameters provided by Apple. All CarPlay Navigation apps must provide route guidance as their primary function. Other kinds of apps, including apps designed primarily to locate points of interest, apps designed primarily to provide services other than navigation, and apps that don’t provide route guidance, are not eligible for the CarPlay navigation app entitlement. For details, see the CarPlay Navigation APIs Addendum to the Apple Developer Program License Agreement.
Request the CarPlay Entitlement
Navigation apps require a special app entitlement for integration with CarPlay. Request that entitlement here.
Once the entitlement is granted:
Log in to your account on the Apple Developer website.
Create a new Provisioning Profile that includes the CarPlay navigation app entitlement.
Import it into Xcode.
Create a key for the CarPlay navigation app entitlement as a Boolean. Type the following into your Entitlements file:
.apple .developer .carplay-maps</key><true/>
The Simulator does not recognize your navigation app without the presence of an iOS Provisioning Profile that supports CarPlay.
When building your app if Xcode is unable to find your entitlement, make sure that your target project setting
CODE is set to the path of your Entitlements.plist file.
Add CarPlay Support to Your Code
The navigation apps look and feel like an app on your iPhone, with the addition of UI elements similar to the built-in Maps app. Your app does not need to manage the layout of UI elements for different screen resolutions or support input hardware like touchscreens, knobs, or touch pads. Your app draws a map on the CarPlay screen and presents the UI elements to the user, and iOS manages the display of the elements and handles the car interface. Follow these steps to add CarPlay support to your code.
Debug in the CarPlay Simulator
Certain CarPlay features are not available in Simulator, so it is important to always test in real CarPlay systems. For example, you need to make sure that your app performs as expected when iPhone is locked since CarPlay is often used while iPhone is in a locked state. You also need to test your app while using other CarPlay features, and ensure that features such as turn-by-turn directions function correctly.
It is highly recommended to develop navigation apps using a car or head unit that supports wireless CarPlay. This allows you to run CarPlay wirelessly while iPhone is simultaneously connected to Xcode on your Mac using a Lightning to USB cable.