简体   繁体   English

如何在每次运行时避免XCode重置iPhone上的位置

[英]How can I avoid XCode resetting the location on my iPhone every time it runs

Every time I run XCode, my location is being reset to a location in London. 每次运行XCode时,我的位置都会重置为伦敦的某个位置。 It doesn't recover until I reset my device. 在重置设备之前,它无法恢复。

How do I avoid this? 我该如何避免这种情况?

This took me a month or two to spot and track down, so I am posting for the benefit of others. 这花了我一两个月的时间来发现和追踪,所以我发帖是为了别人的利益。 as Apple Customer Support were unable to diagnose it, and even went so far as to swap my device for a new one- which of course didn't help. 由于Apple客户支持无法对其进行诊断,甚至甚至将我的设备更换为新设备 - 这当然没有帮助。 There was nothing about this on Google. Google上没有这方面的内容。

I eventually diagnosed it by setting "Find My Friends" to geofence my real location and send a message when it spotted me leave. 我最终通过设置“寻找我的朋友”来确定它,以便对我的真实位置进行地理定位,并在发现我离开时发送消息。 The second I started running my app on Xcode it pinged instantly. 第二个我开始在Xcode上运行我的应用程序,它立即ping。

There is a setting in XCode that sets the GPS to a chosen dummy location whenever you run your app. XCode中有一个设置,可以在您运行应用程序时将GPS设置为所选的虚拟位置。 It can be found by selecting Product>Scheme>Edit Scheme from the top menu, then select "Run appname" on the left and "Options" at the top. 通过从顶部菜单中选择产品>方案>编辑方案,然后选择左侧的“运行appname”和顶部的“选项”,可以找到它。 The one you want is "Core Location: Allow Location Simulation." 你想要的是“核心位置:允许位置模拟”。

Just uncheck that box. 只需取消选中该框即可。 Problem solved. 问题解决了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以在未将其实时插入XCode的情况下模拟iPhone上的位置? - Can I Simulate My Location On My iPhone Without It Being Plugged Into XCode Real Time? 如何确保每次使用Xcode时,iPhone模拟器都可以跳过启动屏幕? - How can I make sure that the iPhone simulator in Xcode will move past the the startup screen every time I use it? 如何在 Xcode 的地图中显示我当前的位置? - How can I show my current location in maps in Xcode? 我想在我的方法中添加到数组中,而不必在每次调用该方法时都将其重置 - I want to add to my array within my method without resetting it every time I call the method 如何在 iphone 中获取录制音频的时间? - How can i get time of my recorded audio in iphone? 每次打开项目时 Xcode 都会意外退出 - Xcode quits unexpectedly every time I open my project 每次移动超过50米时,如何用新位置更新我的代表? - How do I update my delegate with a new location every time it's moved more than 50 metres? 每次启动我的应用程序时都会出现位置图标 - Location icon appears every time I launch my app 每次按下音量按钮时,是否可以让我的 iPhone 4s 将其位置 ping 到服务器? - Is it possible to make my iPhone 4s ping its location to a server every time the volume button is pressed? 我的iOS应用程序中的键盘在iPhone 6上太高。如何在XCode中调整键盘的分辨率? - The keyboard in my iOS app is too tall on the iPhone 6. How can I adjust the resolution of the keyboard in XCode?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM