First, open a Mac Terminal window, then cd to this directory:
$HOME/Library/LaunchAgents
When I dug around in the Apple documentation, I found there are three main directories you can use with launchd
, and that's how I learned about this directory. Here are your three options:
- /Library/LaunchDaemons - Put your plist scripts in this folder if your job needs to run even when no users are logged in.
- /Library/LaunchAgents - Put your plist scripts in this folder if the job is only useful when users are logged in. (Note: I learned that this has the side-effect of your job being run as 'root' after a system reboot.)
- $HOME/Library/LaunchAgents - Put your plist files in this folder if the job is only useful when users are logged in. (When your plist configuration file is placed here, your job will be run under your username.)
Note that when you use the first two directories shown here, you must use the sudo
command to edit your files.
To keep this simple and just see how things work initially, my advice is to use the $HOME/Library/LaunchAgents
folder until you see how things work, then use the other two system folders if/when necessary.