I am trying to perform a WiFi network scan using CoreWLAN but I keep getting these errors:
2015-07-18 01:13:09.353 DummyApp[2720:74054] Error Domain=NSCocoaErrorDomain Code=4099 "Couldn’t communicate with a helper application." (The connection to service named com.apple.airportd was invalidated.) UserInfo=0x608000064600 {NSDebugDescription=The connection to service named com.apple.airportd was invalidated.}
Additionally, I get this in the console:
18/07/15 01:10:03,599 appleeventsd[48]: <rdar://problem/11489077> A sandboxed application with pid 2668, "DummyApp" checked in with appleeventsd, but its code signature could not be validated ( either because it was corrupt, or could not be read by appleeventsd ) and so it cannot receive AppleEvents targeted by name, bundle id, or signature. Error=ERROR: #100013 { "NSDescription"="SecCodeCopySigningInformation() returned 100013, -." } (handleMessage()/appleEventsD.cp #2100) com.apple.root.default-qos
18/07/15 01:10:03,604 sandboxd[277]: ([48]) appleeventsd(48) deny file-read-metadata /Library
The code I am using is as follows:
NSError *error;
CWInterface *iface = [[CWWiFiClient sharedWiFiClient] interface];
NSSet *networks = [iface scanForNetworksWithName:nil error:&error];
if (error == nil) {
NSLog(@"Found networks: %ld", networks.count);
}
else {
NSLog(@"%@", error);
}
This works like charm with sandbox disabled. Am I missing something? Isin't it possible to scan for WiFi networks from within sandbox? I have found two apps on the Mac App Store that do exactly this:
Mac App Store - WiFi Explorer - Apple
Mac App Store - WiFi Scanner - iTunes - Apple
Is it possible that these apps somehow got into the App Store without being sandboxed? They were recently updated so they are not leftovers from from the pre-sandbox era.
Any insights will be helpful. Thank you very much.