English 中文(简体)
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...

最佳回答

I think the best approach is to take control from the CLLocationManager by implementing your own category for it and simulate your expected behavior.

I put a description of this approach here : Testing CoreLocation on iPhone Simulator

问题回答

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





相关问题
Query about getting GPS Location

Is there any way to set Criteria for LocationProvider depending upon the network provider, means determining whether the network provider supports CellSite mode or autonomous mode or any other mode. ...

Android google map myLocationOverlay disappears?

I try to add myLocationOverlay to the map. It was not there at first, then when I send the gps position from the ddms, then the blue shining dot appear. However, after awhile, the blue dot disappear ...

Accessing GPS Data From a .Net Winform Application

Does anyone out there have any experience programatically retreiving the lat/long from a GPS attached to a mobile PC? A team I m on is currently looking at hardware options--as the programmer who ...

Can Google Maps plot points based on Hours Minutes Seconds

I m trying to plot out GPS data that is given to me in Hour Minute Second degree format. Will GLatLng take it in this form or do I need to convert it first. Having a hard time finding anything on the ...

热门标签