模拟真实 iOS 设备上的位置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17436495/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Simulating a location on Real iOS Device
提问by itsaboutcode
Is it possible to simulate a location on iOS Device, say I want to simulate London on the device while I am sitting in Oxford?
是否可以在 iOS 设备上模拟一个位置,比如说我想在我坐在牛津时在设备上模拟伦敦?
Thanks.
谢谢。
回答by Yasir Ali
Yes, It is possible to simulate the location on device in debug mode. All you need is to debug your application on device, and then enable the location from debug menu.
是的,可以在调试模式下模拟设备上的位置。您只需要在设备上调试应用程序,然后从调试菜单启用该位置。
Check this link... https://developer.apple.com/library/ios/recipes/xcode_help-debugger/articles/simulating_locations.html
回答by Lucian Boboc
You can create a GPX file with the desired location/coordinates and you can enable it from the debugger or from the Project scheme select run/options/"Allow location simulation". After you have this enabled and your device connected the location simulation will work on the device to till you reboot it. A good article that explain this can be found here: https://blackpixel.com/writing/2013/05/simulating-locations-with-xcode.html
您可以创建具有所需位置/坐标的 GPX 文件,您可以从调试器或从项目方案选择运行/选项/“允许位置模拟”启用它。启用此功能并连接设备后,位置模拟将在设备上运行,直到您重新启动它。可以在此处找到解释这一点的好文章:https: //blackpixel.com/writing/2013/05/simulating-locations-with-xcode.html
回答by Fede Henze
Maybe this project can help: https://github.com/futuretap/FTLocationSimulatorIt simulate location sending fake data to the coreLocation.
也许这个项目可以帮助:https: //github.com/futuretap/FTLocationSimulator它模拟位置发送假数据到 coreLocation。