I'm building an iOS app that I want to interact with the Native maps application that comes on iPhone & iPad. No maps application seems to be installed on either of the simulators.
How can I test this functionality on the iOS simulator?
When I let Google Maps website take over with the following url
http://maps.google.com/maps?ll=37.785834,-122.406417
This happens
in iOS Simulator menu, go to Features -> Location -> Custom Location. There you can set the latitude and longitude and test the app accordingly. This works with mapkit and also with CLLocationManager.
Install Apps on SimulatorsTo install an app on a connected simulator, follow these steps. Go to Apps > Install Application. Find and open the app you want to install from your Mac. The app appears in the list of installed apps on the right side of the iOS Gateway window.
My Maps isn't available for iPhone or iPad, but you can view your My Maps using Google Maps on your computer.
Use this documentation from Apple: http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/MapLinks.html
As it says there:
If the Maps application is not installed on the device, opening a map URL forwards the request to the Google Maps website.
So you can test this in the simulator, but it will open in Safari instead.
[someUIApplication openURL:[NSURL URLWithString:@"http://maps.google.com/maps?q=London"]]
This will open the maps app from apple.
NOTE: THIS ONLY WORKS ON THE DEVICE ITSELF. NOT IN THE SIMULATOR.
It's one of the "missing" features of the simulator.
Like Woz said, it will open on safari, not in the native app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With