CLLocationManager Simulator 来模拟汽车移动?
我很长一段时间以来一直在寻找像 CLLocationManager 模拟器这样的东西,它可以让我模拟 GPS 位置(可以通过 CLLocationManager 检索的 CLLocation 实例) /code> 标准委托机制)沿着预定义的路线例如(使用 KML 或 GPX 文件 作为输入,或者其他什么,但 KML 会很好;)。
Android 模拟器上可以使用类似的东西,我想知道 iPhone 模拟器是否也存在类似的东西。 至少这会很棒,并且会加快模拟器上的测试速度,而不必真正驾驶......:/
如果不存在这样的情况,那么你会采取什么方法来伪造这种行为并以这种方式实现模拟器客户不受影响吗? (例如,CLLocationManager 的委托中没有代码更改。)
感谢您的链接、提示、方法...
I'm looking since quite a long time something like aCLLocationManager
simulator that would enable me to simulate GPS positions (CLLocation
instances that could be retrieved through theCLLocationManager
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 theCLLocationManager
for instance.)
Thanks for your links, hints, approaches...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法注入模拟器,但可以对 CoreLocation 进行子类化:
http://code.google.com /p/dlocation/
是 CoreLocationDelegate 的子类,用于在模拟器上返回设备上的真实数据和文本文件中的数据。
更多信息请点击这里
在 iPhone 模拟器上测试 CoreLocation
HTH
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
我认为最好的方法是通过实现您自己的类别并模拟您的预期行为来从 CLLocationManager 获取控制权。
我在这里描述了这种方法:
在 iPhone 模拟器上测试 CoreLocation
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