Test cross App Launching on CarPlay simulator

Hello everyone,

I am currently trying to build a CarPlay application with the Charging entitlement. As part of my application I have a List Template which shows different entries and should start navigation to one of them on click on it. Therefore I used the answer of this question: https://developer.apple.com/forums/thread/669838?login=true and implemented following function:


    static func launchmap(cpAppScene: CPTemplateApplicationScene, latitude: String, longtitude: String, carplay : Bool = true) {
        let urlString: String!
        if UIApplication.shared.canOpenURL(URL(string:"comgooglemaps://")!) {
            urlString = "comgooglemaps://?&daddr=\(latitude),\(longtitude)&directionsmode=driving"
        } else {
            urlString = "http://maps.apple.com/?daddr=\(latitude),\(longtitude)&dirflg=d"
        }
        if let url = URL(string: urlString) {
            if (carplay) {
                cpAppScene.open(url, options: nil, completionHandler: { (Void) in print("completed!")})
            } else {
                UIApplication.shared.open(url)
            }
        }
    }

Now my main concern is: I can't test this functionality in the CarPlay simulator because it comes without safari and Apple Maps as well as I can't install any external apps like Google Maps. Trying to test this functionality in my car leads to it crashing and I am just frustrated on figuring out how to debug it without the simulator allowing us to install external apps and coming without maps.

Are there any ideas?

Thank you and best regards Dennis

There definitely shouldn't be a crash from opening a URL! Is the crash in your app code or in the CarPlay framework? If you're able to reproduce the crash, please capture diagnostics and send us a report as described here. Thanks! https://developer.apple.com/bug-reporting/profiles-and-logs/

Test cross App Launching on CarPlay simulator
 
 
Q