【发布时间】:2016-02-28 18:59:17
【问题描述】:
我正在尝试在 ios 模拟器上模拟移动位置(高速公路驱动器),但它根本不起作用。唯一有效的位置是静态 Custom Location... 选项。
重现问题:
- 打开
Xcode>open developer tools>simulator, - 打开地图应用
- 将
debug>location设置为“高速公路” - 按左下角的定位按钮
它加载了一会儿,然后说:
Current Location Not Available
Your current location cannot be determined at this time
当我打开system.log 时,我看到了消息:
SimulatorBridge[41185]: Selected location simulation scenario does not exist
我正在使用 Xcode 7.1.1 和 iPhone 6s / iOS 9.1 模拟器。我试过了:
- 设置默认位置
- 在
Simulator>Reset Content and Settings...中重置模拟器 - 重新安装模拟器
但似乎没有任何效果。有谁知道我可能做错了什么?
【问题讨论】:
-
您是否尝试过先打开应用程序?不要做
Xcode>open developer tools>simulator;在 Simulator...Debug...Location 菜单中设置位置。 -
嗨,是的,我尝试先打开我的测试应用程序,并将位置设置为
Debug>Location,但似乎没有任何效果(自定义除外)。我正在使用安装了 cocoapods 的SwiftLocation(根据需要调用 requestAlwaysAuthorization 和 requestWhenInUseAuthorization),并且我在 Info.plist 中同时设置了NSLocationAlwaysUsageDescription和NSLocationWhenInUseUsageDescription,但没有运气。 -
过去几周在 SO 上报告了几个类似的问题。唯一建议的解决方案是在实际测试设备上运行,而不是在模拟器上运行。
标签: ios xcode swift ios-simulator