位置模拟在 Xcode 10 和 iOS 12 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52726731/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:50:27  来源:igfitidea点击:

Location Simulation not working in Xcode 10 and iOS 12

xcodeios-simulator

提问by inexcitus

I am developing an app that sues GPS. In the simulator I always used the location simulation feature of Xcode which always worked for me. I selected the Debug - Location - Freeway Drive option in Xcode 10. Whenever I select some preset to simulate, Xcode shows the following error:

我正在开发一个起诉 GPS 的应用程序。在模拟器中,我总是使用 Xcode 的位置模拟功能,它总是对我有用。我在 Xcode 10 中选择了 Debug - Location - Freeway Drive 选项。每当我选择一些预设进行模拟时,Xcode 会显示以下错误:

[Client] #Spi, Interrupted

GPS is enabled on the simulated device and the app has permission to access the GPS. I already tried to restart the simulator multiple times, selected another device, but no device works. Does anyone have a solution to this?

在模拟设备上启用 GPS,并且应用程序有权访问 GPS。我已经多次尝试重新启动模拟器,选择了另一台设备,但没有设备工作。有没有人有解决方案?

Regards

问候

回答by Michael Young

Xcode 10 is broken with respect to Location Services in my experience. I've had to go back to 9.4 to develop and debug apps, but even then I have had problems with running apps originally modified with Xcode 10 running in iOS 12.

根据我的经验,Xcode 10 在定位服务方面已损坏。我不得不回到 9.4 来开发和调试应用程序,但即便如此,我在运行最初使用 iOS 12 中运行的 Xcode 10 修改的应用程序时遇到了问题。

Apple is having serious, SERIOUS quality control issues and legacy issues with each new release of Xcode and iOS. I'm very frustrated and annoyed.

Apple 在 Xcode 和 iOS 的每个新版本中都存在严重的质量控制问题和遗留问题。我非常沮丧和恼火。

回答by bkeepers

I was having this issue and reseting the simulators seems to have fixed it for now:

我遇到了这个问题,重置模拟器现在似乎已经解决了:

$ xcrun simctl erase all

回答by SwiftNewling

Simply click City Bicycle Runand then City Runin Debug -> Locationin the Simulator over and over again until it works. At least it worked for me that way

只需单击City Bicycle Run,然后City RunDebug -> Location模拟器中一遍又一遍地单击,直到它起作用为止。至少它对我有用

回答by Loup G

This worked intermittently as a workaround for me:

这间歇性地作为我的解决方法:

On the simulator debug menu, select location and freeway drive (or whatever you want) several times until it starts to track the location.

在模拟器调试菜单上,多次选择位置和高速公路驱动器(或任何你想要的),直到它开始跟踪位置。

It also helps to build the app on the simulator again

它还有助于再次在模拟器上构建应用程序

Good luck!

祝你好运!

回答by gutgemeint

I'm suffering the same issue with Xcode 10.1 and iOS 12. Several restarts of the App and toggling between different locations (None, Apple, City Bicycle Ride) make it work again.

我在 Xcode 10.1 和 iOS 12 上遇到了同样的问题。多次重新启动应用程序并在不同位置(无、Apple、City Bicycle Ride)之间切换使其再次工作。

Quite annoying

很烦人

回答by dhj01776

Looks like the location simulator has not been fixed in Xcode 10.1 update.

Xcode 10.1 更新中似乎没有修复位置模拟器。