I have a simple piece of demo code I am attempting to write for MacOS Yosemite that uses CoreWLAN to report on WiFi events. I've tried every combination I can think of Sandboxed, Signed, etc., all to no avail. Currently, I have the app set for Sandbox mode, and allowing outbound network connections in the entitlements. Any ideas as to how to get this to work? Sample code and scenario below:
import CoreWLAN
class WirelessMonitor: CWEventDelegate {
func registerForEvents() {
let client = CWWiFiClient.sharedWiFiClient()
client.delegate = self
var error:NSError?
puts("Registering for SSID change...")
client.startMonitoringEventWithType(.SSIDDidChange, error: &error)
if (error != nil) {
puts("error registering for SSID Change: \(error)")
}
}
func ssidDidChangeForWiFiInterfaceWithName(interfaceName: String!) {
print("ssid changed.")
}
}
When I run this, I receive an error upon calling startMonitoringEventWithType(...):
"Couldn’t communicate with a helper application." (The connection to service named com.apple.airportd was invalidated.)
In the MaOS console, I see this message:
7/18/15 12:19:11.753 AM sandboxd[504]: ([4105]) WiFi Debugger(4105) deny mach-lookup com.apple.airportd