I am testing an app that has some CarPlay functionalities. I activated the CarPlay window in the simulator by changing the default options using
defaults write com.apple.iphonesimulator CarPlay -bool YES
which works perfectly when it comes to starting up the CarPlay windows, either when the simulator starts automatically after the application is compiled in debug or if I manually open up the CarPlay window through Hardware -> External Displays -> CarPlay
when the app is already running in the simulator. The problem is that, in both cases, the main simulator window goes dark (after showing the CarPlay splashscreen simmilar to the one seen on the phone in this image).
Now, I don't exactly know what the real life behavior is supposed to be, but I can't manage to simply execute a "shut-down" behavior on the CarPlay window and switch back to the main simulator window so that it displays the app (or anything else for that matter). Currently, if I got back to the simulator menu and select Hardware -> External Displays -> None
, the CarPlay window simply dissapears, but the main simulator window stay blacked out.
So, my question is, how can one simulate a CarPlay "shutdown" behavior when using the simulator, and how can I get back the OS in the main simulator window ? On a more development focused side, I would also like to know exactly if and how I can detect that the Media Player becomes "turned off" when CarPlay shuts down, or, more specifically, if there is a way that one can programatically observe the event where the CarPlay's media control capabilities become "unavailable".