【问题标题】:Unit Testing Swift, CoreLocation issue with info.plist单元测试 Swift,CoreLocation 问题与 info.plist
【发布时间】:2017-08-25 16:22:16
【问题描述】:

我正在使用 XCode 测试我的项目,它有一个更新位置的 CLLocationManager。我在测试和项目 info.plist 文件(两者)中添加了隐私 - 始终使用说明。 但是当我在这里运行测试时是日志:

This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationAlwaysUsageDescription key with a string value explaining to the user how the app uses this data

任何人都有这个问题或知道如何解决它

【问题讨论】:

  • 你的 plist 的目标是什么?它还包括 test 目标吗?
  • 不,它不包括测试目标。所以我确实为 plist 添加了测试目标。但仍然得到相同的日志。

标签: swift unit-testing core-location xctest info.plist


【解决方案1】:

我已经通过一个虚拟应用程序进行了测试,它解决了这个问题。

唯一的事情是我不知道为什么,但是当我在虚拟应用程序的测试中使用 CLLocationManager 请求始终授权时。不允许。

【讨论】:

    猜你喜欢
    • 2012-12-01
    • 2016-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多