Search code examples
macosmotion-detectionappstore-sandboxentitlements

OS X Cocoa access appleSMC from sandboxed app


I want to access AppleSMC device from a sandboxed app , does anyone know what entitlement should I use to access Temperature sensors and FANs RPM?

here is the code I am using to access it :

kern_return_t result;
mach_port_t   masterPort;
io_iterator_t iterator;
io_object_t   device;

/*result =*/ IOMasterPort(MACH_PORT_NULL, &masterPort);

CFMutableDictionaryRef matchingDictionary = IOServiceMatching("AppleSMC");
result = IOServiceGetMatchingServices(masterPort, matchingDictionary, &iterator);

Thanks in advance


Solution

  • AFAIK AppleSMC is not considered API and thus there's no corresponding entitlement to allow you to access it. (Source Apple Developer Forum message 1082393)

    There might still be Apps in the AppStore that are not sandboxed as sandboxing was introduced later. See answer "circumvent sandbox" for more details.

    This also applies for the App in Question "MagicanPaster" which had it's last update in May 2011, long before sandbox was implemented.

    You may distribute your app outside the Mac App Store, here a brief overview by matt gemmell on what it takes.