2015-04-24 40 views
0

目前在iOS模拟器中,您可以模拟随时间改变您的位置的城市运行。 您也可以在iOS设备上模拟您的位置,但仅限个别坐标。是否有可能模拟城市运行,但在设备上?有没有办法像设备上的“City Run”一样模拟多个位置?

+1

看到这个:https://developer.apple.com/library/ios/recipes/xcode_help-debugger/articles/simulating_locations.html? – sasquatch

+0

就像我说过的,我意识到可以设置单个坐标,然后我将自动化位置坐标随时间变化。 – Patrick

回答

1

我会看看使用GPX文件(http://wiki.openstreetmap.org/wiki/GPX)。类似于如何模拟发现的位置https://developer.apple.com/library/ios/recipes/xcode_help-debugger/articles/simulating_locations.html,您可以上传包含多个GPS点信息的GPX文件。

另一个选项取决于您要做的是使用CLLocationManager的子类从文件中读取数据。这里有一个例子(https://github.com/Raizlabs/RZLocationSimulationManager/tree/develop),不幸的是,它没有任何示例代码,但是您应该能够从代码中了解它是如何完成的。

+0

这可能会是最好的,谢谢链接到回购亚历克斯! – Patrick

相关问题