在真实的 iOS 设备上模拟虚假位置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25869753/
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
Simulate fake location on real iOS device
提问by AWSSET
I want to simulate fake location on my iPhone 5S device using specific longitude and latitude. Is there a way to do this in XCode. I tried using the simulate location feature by adding a GPX file in XCode but it's not working. Thank you in advance.
我想使用特定的经度和纬度在我的 iPhone 5S 设备上模拟假位置。有没有办法在 XCode 中做到这一点。我尝试通过在 XCode 中添加 GPX 文件来使用模拟位置功能,但它不起作用。先感谢您。
回答by buttcmd
It is possible.
有可能的。
You only have to: 1) plug your device to the computer. 2) run an app in the real device (it is the same which application). It is only to have the menu enabled. 3) in Xcode (not in the simulator) Go to menu: Debug -> Simulate Location and select one or add a GPX file.
您只需:1) 将您的设备插入计算机。2)在真实设备上运行一个应用程序(哪个应用程序是一样的)。只需启用菜单即可。3) 在 Xcode 中(不在模拟器中)转到菜单:Debug -> Simulate Location 并选择一个或添加一个 GPX 文件。
It will simulate the location not only for the application executed but for all of them.
它不仅会模拟执行的应用程序的位置,还会模拟所有应用程序的位置。
I suppose that the phone must be in developer mode but if you run apps from Xcode it must be anyway.
我想手机必须处于开发人员模式,但如果您从 Xcode 运行应用程序,则无论如何都必须如此。
I've tested it from Xcode 6 in an iPhone 4 iOS 7.1.2
我已经在 iPhone 4 iOS 7.1.2 中从 Xcode 6 对其进行了测试
Hope it helps
希望能帮助到你