StartAtLoginController icon indicating copy to clipboard operation
StartAtLoginController copied to clipboard

SMCopyAllJobDictionaries is deprecated in OS X 10.10

Open ixeau opened this issue 10 years ago • 3 comments

SMCopyAllJobDictionaries is deprecated in OS X 10.10

ixeau avatar Jan 07 '15 19:01 ixeau

According to the dev forums and this SO question there isn't currently a replacement.

keith avatar Jan 13 '15 17:01 keith

As of WWDC 2017, Apple engineers have stated that this is still the preferred API to use. To enable your app to compile wrap SMCopyAllJobDictionaries with the following:

  #pragma clang diagnostic push
  #pragma clang diagnostic ignored "-Wdeprecated-declarations"
    CFArrayRef  cfJobDicts = SMCopyAllJobDictionaries(kSMDomainUserLaunchd);
  #pragma clang diagnostic pop

If this issue is important to your app and you'd like a resolution, please file a radar; this helps Apple engineers determine priorities of work items.

BlindDog avatar Jun 09 '17 23:06 BlindDog

So I did file a radar on this, and got the following response:

Looking at the use of SMCopyAllJobDictionaries in StartAtLoginController, I see that it is used to retrieve the value of OnDemand key. That key is not related to SMLoginItemSetEnabled. Its value is the opposite of KeepAlive, please refer to man launchd.plist. SMJobIsEnabled is likely a better fit here.

However, I haven't been able to find documentation on SMJobIsEnabled and am therefore not sure how I'd go about updating this... maybe someone else here has more experience in this area?

danmessing avatar Oct 30 '18 05:10 danmessing