# Launchd | | **Launchd** is an init and operating system service management daemon created by Apple Inc. as part of macOS to replace its BSD-style init and SystemStarter. There have been efforts to port launchd to FreeBSD and derived systems. | |-|-| | | wikipedia:: [Launchd](https://en.wikipedia.org/wiki/Launchd) | `launchd` `launchctl` > Apple defines a LaunchDaemon as a general background service, without any form of GUI. Specifically, LaunchDaemons are not allowed to connect to the macOS window server. LaunchAgents do have access to the GUI, and to other system features such as locating the current user’s Home folder, but generally have more limited interfaces than do regular apps. ## HowTo - Create a plist file to define an Apple launchd/launchctl service to run a script or launch apps, etc. - [Harmon Ops - updateMac example](Harmon Ops - updateMac example) - This file needs to be copied to /Users/evan/Library/LaunchAgents - Enable - `launchctl load /Users/evan/Library/LaunchAgents/com.evan.updateMac.plist` - Disable - `launchctl disable /Users/evan/Library/LaunchAgents/com.evan.updateMac.plist` ## Commands - `launchctl` - `list` - `start` - `stop` - `enable` - `disable` - `reboot` - `kickstart` - `kill` ## Tools - [[LaunchControl]] - [LaunchControl: The launchd GUI](https://www.soma-zone.com/LaunchControl/) - [[Lingon]] - [Lingon - Peter Borg Apps](https://www.peterborgapps.com/lingon/) ## Sources - Good comprehensive - [A launchd Tutorial](https://www.launchd.info/) - [Running software automatically using launchd – The Eclectic Light Company](https://eclecticlight.co/2021/09/13/running-software-automatically-using-launchd/)