launchd Job Builder
Fill in a form to make a launchd job: a LaunchAgent or LaunchDaemon property list that runs a program at login, on a schedule (cron expressions welcome), every few seconds or when a file changes. Open an existing .plist to check it, with common mistakes pointed out, and you get the launchctl commands to load, run and remove it.
About this tool What it's for, how to use it and an example
What it's for
Make a launchd job: the property list file macOS reads to start a program for you at login, on a schedule, every few seconds, when a file changes, or to keep it running. launchd takes the place of cron on a Mac, but its files are fiddly to write by hand and fail quietly when something is wrong.
For example, when you want a backup script to run at 2:30 every weekday morning, fill in its path and the schedule
30 2 * * mon-fri here, save the file into ~/Library/LaunchAgents and load it with the command given.
How to use it
Give the job a label (a reverse domain name such as com.example.backup, which also names the file) and choose
the kind: an agent runs while you’re logged in, and a daemon runs for the whole Mac, even before anyone logs in
(as root unless you name a user). The kind is remembered in this browser.
Put the program on the first line and each argument on a line of its own, as launchd runs the program directly. To
use pipes, ~ or $VARIABLES, tick Run as a shell command, which runs the lines through /bin/zsh -c. Then
choose when it runs: at load, every N seconds, on a cron schedule (turned into launchd’s StartCalendarInterval,
with names such as mon and shortcuts such as @daily allowed), when paths change, or kept running. Log files, a
working folder and environment variables are under Logs, folder and environment.
Mistakes are listed as you type. Save the .plist downloads the file, and the commands below it copy it into
place, check it with plutil, load it, run it straight away, show its state and unload it.
To check a job you already have, open its file at the top of the page: drop it on the page or choose it, or paste
its XML. The form fills in from it, and the checks on it are listed above the form. Keys the form has no field for,
such as Sockets, are kept as they are and written into the file again. Binary plists open too.
Example
Press Try an example. It fills in an rsync backup that runs at 30 2 * * mon-fri and logs to
/tmp/com.example.backup.log.
The message says Save it as ~/Library/LaunchAgents/com.example.backup.plist. The property list has
StartCalendarInterval as an array of five entries, each with Minute 30, Hour 2 and a Weekday from 1 to 5,
and the commands load it with launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.example.backup.plist.
Good to know
launchd doesn’t expand ~ or $VARIABLES in paths, doesn’t search your PATH beyond the system folders (so
Homebrew programs need their full path), and doesn’t create the folder for a log file. When a plist is opened, the
checks cover the keys launchd reads, their types, paths, schedule ranges and what it needs to run. No problems
found in what this tool checks doesn’t mean launchd will accept the job: use the plutil and launchctl commands
to find out. A job scheduled while the
Mac is asleep runs when it wakes, but one scheduled while it’s off is skipped. A program that reads your files may
also need Full Disk Access in System Settings › Privacy & Security.
Guide: Customising your Mac: icons, shortcuts, links and scheduled jobs
Open a plist
Make a job
When it runs
Logs, folder and environment
Built with The third-party code and data this tool uses, and their licences
This tool uses no third-party code or data of its own: its code was written for this site.
Every page also uses Montserrat (SIL Open Font License 1.1).
Everything the site uses is on Credits and licences.
Private: this tool runs in your browser. Nothing you type, paste or choose leaves this page.
Saved you a few minutes? Say thanks with a coffee.
Something wrong with this tool, or missing from it? Report a bug or suggest a feature.