Dev:Daemons

Daemons are programs that run as background processes. These programs may have a long life cycle. They exist in a paradigm different from tweaks: they can exist by themselves and do not have to be injected into other processes.

Several tweaks and programs use them, such as f.lux, Gremlin, RocketBootstrap, SafariDownloadEnabler, and OpenSSH.

Daemons running as part of iOS include backboardd (handles events from hardware), launchd (handles other daemons), lockdownd (provides system information), notifyd (exchanges Darwin notifications), and wifid (the back-end of MobileWiFi.framework). (See Category:Daemons.)

How to make a daemon
There are two steps: making a program and making a plist for it.

The program
While idle, the program should use the least possible resources. Remember that it is working along with many other already existing processes.

Given that memory isn't shared across processes, one cannot call functions or get objects freely between processes. To solve this, one must use some form of IPC to communicate with the daemon.

The plist
Place your plist, following the reverse DNS notation (com.your.daemon), in. Use XML version of plist files, not NeXTSTEP, as some types may be misinterpreted by launchctl upon loading the plist.

Required Keys

Permission related Keys

Launch related Keys

Lifetime related Keys

Control and Debug related Keys

Other Keys

To be done: Subrows for Dictionary Keys, maybe add a few more keys

Examples

 * iOS daemon