Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test an iOS application on the CarPlay simulator

I am trying to develop an iOS application compatible with CarPlay.

According to this post Is iOS CarPlay API Public? How to Integrate CarPlay?, I have to be enrolled with Apple’s MFi program, but I have noticed that there’s the possibility to use a CarPlay simulator with Xcode: launch the Simulator, then Hardware -> External Displays -> CarPlay (I use Xcode 8). Once you have opened it, you see that the Message App is working in the CarPlay simulator so I imagine that there is the possibility to try custom application in this simulator without being enrolled in the MFi program. I wonder if anyone has tried to launch an application on the CarPlay simulator and, in case of positive answer, he can explain how he did.

I have also watched the WWDC 2016 (https://developer.apple.com/videos/play/wwdc2016/722/ open it with Safari) that explains the CarPlay system and how it works. At the end of this presentation, they say that you have to declare a string protocol name (like com.brand) in the SupportExternalAccessoryProtocols key in the Info.plist file, but I don't understand how to get the string protocol name.

I also don’t find any information about the simulator and how to develop application compatible with it.

If someone knew something concerning it, it would be a great help.

Thanks in advance.

like image 451
F. DePa Avatar asked Mar 01 '17 08:03

F. DePa


People also ask

Do all apps work on Apple CarPlay?

Unfortunately, only a small selection of iOS apps are compatible with CarPlay. The vast majority of them fall into one of three categories: audio, navigation, or messaging. As a result, you probably won't end up installing too many of these apps, since they overlap a lot.


2 Answers

You don't need to add anything for the SupportExternalAccessoryProtocols key to run a basic CarPlay app in the simulator. This is for declaring protocols for functionality that might be specific to a particular set of head units.

What you are probably missing is the playable content entitlement. If you don't have an entitlements file, you'll need to create it for your app;-

xcode navigator

Then add a boolean value of YES for the com.apple.developer.playable-content key

entitlements file

This should now show your app on the CarPlay home screen in the simulator. As you allude, you won't be able to run that app on a physical device unless you can get Apple to add that entitlement to your account

like image 95
deftangel Avatar answered Sep 23 '22 04:09

deftangel


As of iOS 12 there is now the entitlement of com.apple.developer.carplay-maps for navigation based apps which works in the same way as com.apple.developer.playable-content so you can test your App in the Simulator. You may need to enable the CarPlay simulator with the terminal command defaults write com.apple.iphonesimulator CarPlay -bool YES to get it to show up.

like image 21
svarrall Avatar answered Sep 20 '22 04:09

svarrall