2 Replies
      Latest reply on Feb 3, 2017 3:15 PM by BoilerLA
      BoilerLA Level 1 Level 1 (0 points)



        I'd like to create a background service (daemon) that is launched periodically so that it can perform some basic periodic tasks when the machine has spare cycles. Ideally we'd use the xpc_activity APIs, and Quinn has posted before that "XPC activity does not require the job to be loaded all the time.". https://forums.developer.apple.com/thread/23361


        But what I can't tell is if by job, it's meant a launchd daemon that is created using a launchd.plist(5). That man page has no reference to any way to use xpc_activity. We could use the com.apple.xpc.activity key in our launchd.plist but there's no documentation on that key, nor do I know if it's even "public".


        We could have a tool that is launched once, calls xpc_activity to register itself, and then exits--but then the service lifecycle gets more hazy when we want to unregister said service.