如何解决/解决 Xcode 10.1/iOS 12.1 中出现的“信号强度查询返回错误”日志?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/53526194/
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
How to troubleshoot/resolve "Signal strength query returned error" logs that are appearing in Xcode 10.1/iOS 12.1?
提问by Phil
Recently updated to iOS 12.1 (from 12.0), Xcode 10.1 (from 10.0) and seeing a flood of error messages in the Xcode console when debugging on my physical device like the following:
最近更新到 iOS 12.1(从 12.0)、Xcode 10.1(从 10.0)并且在我的物理设备上调试时在 Xcode 控制台中看到大量错误消息,如下所示:
[NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x28051d700, domain=1, instance=1>
[NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x28051d700, domain=1, instance=1>
I get a couple of these logs every couple seconds, the only thing that changes is the hex value for the CTServiceDescriptor. There have been no code changes so I have to assume its related to the iOS or Xcode updates.
我每隔几秒钟就会收到几个这样的日志,唯一改变的是 CTServiceDescriptor 的十六进制值。没有代码更改,所以我必须假设它与 iOS 或 Xcode 更新有关。
As far as I can tell it doesn't appear to have any performance impact, the app is operating as expected and my phone is working (its even updating its signal strength!). I've been unable to find anything helpful/relevant across Stack Overflow, Google, or the Apple Developer forums though I made a similar post to the latter that I'll link here once the post is approved.
据我所知,它似乎没有任何性能影响,应用程序按预期运行,我的手机正在运行(它甚至更新了它的信号强度!)。我在 Stack Overflow、Google 或 Apple Developer 论坛中找不到任何有用/相关的内容,尽管我发布了与后者类似的帖子,一旦帖子获得批准,我将链接到此处。
Any suggestions/insight into how I could troubleshoot this further or resolve would be greatly appreciated. Thanks!
任何有关我如何进一步解决或解决此问题的建议/见解将不胜感激。谢谢!
采纳答案by Louis St-Amour
It seems to be a side-effect of calling [CTTelephonyNetworkInfo new];
under newer versions of iOS and can be safely ignored, I think. I'm not sure there's anything app developers can do to fix this, it appears to be a side-effect that signalStrength
inside CTTelephonyNetworkInfo
is hidden from public apps in recent versions of iOS (9+). This is nothing new, but it's noisier about the permissions error here under iOS 12.1 (maybe other versions?).
[CTTelephonyNetworkInfo new];
我认为,这似乎是在较新版本的 iOS 下调用的副作用,可以安全地忽略。我不确定应用程序开发人员可以做些什么来解决这个问题,这似乎是一个副作用,即在最新版本的 iOS (9+) 中对公共应用程序隐藏了signalStrength
内部CTTelephonyNetworkInfo
。这并不是什么新鲜事,但在 iOS 12.1(也许是其他版本?)下这里的权限错误更加嘈杂。
CTTelephonyNetworkInfo
appears to be a hastily-revised API, for public use at least: For example, it had bugs in v12 when returning carrier info that was fixed in v12.1. why do serviceSubscriberCellularProviders return nil? (in iOS 12)
CTTelephonyNetworkInfo
似乎是一个匆忙修改的 API,至少供公众使用:例如,它在返回 v12.1 中修复的运营商信息时在 v12 中存在错误。为什么 serviceSubscriberCellularProviders 返回 nil?(在 iOS 12 中)
I'm also reminded of the extraneous permissions errors that appear frequently in macOS console logs - https://eclecticlight.co/2016/09/23/sierras-console-promising-but-incomplete/- or the Xcode 8 bug where in an early beta the Simulator was extremely noisy. Sometimes the internal chatter slips out to an external release, and there's not much anyone outside Apple can do about it...
我还想起了 macOS 控制台日志中经常出现的无关权限错误 - https://eclecticlight.co/2016/09/23/sierras-console-promising-but-incomplete/- 或 Xcode 8 错误模拟器的早期测试版非常嘈杂。有时,内部讨论会转为外部发布,而 Apple 以外的任何人都无能为力……