美文网首页
xcode 10 配合 iOS 12 获取不到WIFI名

xcode 10 配合 iOS 12 获取不到WIFI名

作者: hao_da_da | 来源:发表于2018-09-20 15:17 被阅读0次

        昨天下班趁热更新了一波xcode 10,早上来发现{}折叠终于回来了,喜大普奔。

        然后坑就开始来了,测试反应今天刚发的包获取不到WIFI名,自测了一下发现iOS12之前的版本都可以,还有线上的版本在iOS12系统下运行也可以。

        对比了一下,发现是CNCopyCurrentNetworkInfo 方法获取不到SSID info。

        最后在官网(https://developer.apple.com/documentation/systemconfiguration/1614126-cncopycurrentnetworkinfo)上找到了这么段话:

To use this function in iOS 12 and later, enable the Access WiFi Information capability for your app in Xcode. When you enable this capability, Xcode automatically adds the Access WiFi Information entitlement to your entitlements file and App ID.

        配上  Access WiFi Information 就解决了。

记录个刚升级xcode时编译坑

 error: unexpected duplicate task: DataModelCompile

报的重复任务,最后指向 xcdatamodeld 文件

解决方案是把 Build Phases 中 Compile Sources 中xcdatamodeld文件删掉

        Thats all.

相关文章

网友评论

      本文标题:xcode 10 配合 iOS 12 获取不到WIFI名

      本文链接:https://www.haomeiwen.com/subject/cphnnftx.html