Scan for WiFi networks within sandbox

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.

Replies

I am trying to perform a WiFi network scan using CoreWLAN but I keep getting these errors:

CoreWLAN is not supported within the sandbox, something that we've actually documented in the Determine Whether Your App Is Suitable for Sandboxing section of the App Sandbox Design Guide.

I have found two apps on the Mac App Store that do exactly this

It's déjà vu all over again (-:

Please read this thread.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hello,


Is CoreWLAN still not available in the sandbox in OS X 10.11? Are there any plans to add an entitlement for that?


Thank you!


Gabriel Arjones

Is CoreWLAN still not available in the sandbox in OS X 10.11?

I answered this in the other place you asked it.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Is it possble to request and gain special entitlement for an app, like com.apple.wifi.scan.

Is it possble to request and gain special entitlement for an app, like

com.apple.wifi.scan
.

Not that I’m aware of.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

How/Where can I request (apple team) for special entitlement?

There are no special entitlements associated with CoreWLAN. There is, however, a long and complex story here. You can learn more by reading thread thread.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"