how to test geolocation on simulator
Asked Answered
L

3

15

I'm starting with geocoding, and after read a few things I realize that are some people using the simulator for testing their code.

Is that possible!?? Can someone tell which tools use!? (it's better than walking around)

Thanks

Lymphocyte answered 11/1, 2012 at 12:33 Comment(0)
N
30

XCode 4.2 with iOS 5 now supports "Location simulation", you can refer it HERE.

Steps to use this feature:

  1. Build & run your app in iPhone 5.0 Simular.
  2. At the top menu bar, you'll find Debug -> Location -> Custom Location..(or you can choose to use others).
  3. Set the Latitude & Longitude for the location.
Nullify answered 11/1, 2012 at 12:55 Comment(0)
D
5

As of iOS 5 and Xcode 4.1 is is now possible to test location in the simulator, There are also premade classes for this such as : https://github.com/progrmr/CLLocationManager-simulator

Deal answered 11/1, 2012 at 12:36 Comment(1)
Thank You! You give a good answer. But Kjuly solution is more comfortable to use.Lymphocyte
M
0

To add to Kjuly's answer, if it throws error such as "code":2 for me, then try to put instead of Debug->Location->Custom location the other option such as Apple, City Run etc. For me it dropped out the error and then you can turn back to Custom location.

Found this helpful on: Geolocation is not working in iOS 8 simulator

Misdemeanor answered 3/8, 2016 at 12:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.