简体   繁体   中英

CNCopyCurrentNetworkInfo getting nil when app is created through command line tools

My app's deployment target is iOS 13. So I am using CNCopyCurrentNetworkInfo for getting the wifi SSID information. I am facing a strange issue only when I archive and distribute my enterprise app through command line tools. The wifi SSID info is always getting nil when the app is created through command line tools. There are no issues when I archive the app from XCode.

Commands that I have used for creating and exporting the archive are:

  • xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme archive -configuration MyConfig -sdk iphoneos -archivePath MyArchivePath CODE_SIGNING_ALLOWED=NO
  • xcodebuild -exportArchive -archivePath MyArchivePath -exportPath MyExportPath -exportOptionsPlist MyExportOptionPlist

Note: I have added all the necessary entitlements and other info for the ssid access like

  • Privacy - Location When In Use Usage Description
  • Access WiFi Information in entitlements

Dropping the CODE_SIGNING_ALLOWED=NO option fixed my problem. I got the solution from the developer portal .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM