Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CLLocationManager Simulator to simulate car moves?

I'm looking since quite a long time something like a CLLocationManager simulator that would enable me to simulate GPS positions (CLLocation instances that could be retrieved through the CLLocationManager standard delegate mechanism) along a predefined route for instance (with a KML or GPX file as input, or whatever, but KML would be nice ;).

Something like this is available on the Android emulator and I was wondering if anything like this would exist for the iPhone simulator. At least this would be great and would speed up testing on the simulator instead of having to drive for real.... :/

If nothing like this exists, what would be your approach to fake such behavior and implement the simulator in such a way that the client is not impacted? (No code change in the delegate of the CLLocationManager for instance.)

Thanks for your links, hints, approaches...

like image 891
yonel Avatar asked Nov 05 '22 17:11

yonel


1 Answers

You can't inject the simulator, but you can subclass CoreLocation:

http://code.google.com/p/dlocation/

which subclasses CoreLocationDelegate to return real data on a device and data from a text file when on the simulator.

More info here

Testing CoreLocation on iPhone Simulator

HTH

like image 134
Andiih Avatar answered Nov 12 '22 09:11

Andiih