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
Am I missing something here?
So, it looks like some issue with the archive command.
OK.
Going back to your first post, you wrote:
xcodebuild … CODE_SIGNING_ALLOWED=NO
What’s up with that CODE_SIGNING_ALLOWED option? That’s not how the Xcode app does things. Specifically, when you archive from the app, the app in the archive will typically be signed with your Apple Development signing identity.
If you drop that option, does it fix things?
Keep in mind that exporting from the archive tries to preserve entitlements. But entitlements are carried by the code signature, so if the app in the archive isn’t signed then there’s nothing to preserve.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"