Skip to content

launchd Plist Generator

Configure Service

Program Arguments
Schedule Type

Leave fields as "Any" to match all values

Environment Variables
Live XML Preview30 lines
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.user.service</string>
  <key>Program</key>
  <string>/usr/local/bin/python3</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/python3</string>
    <string>/path/to/script.py</string>
  </array>
  <key>WorkingDirectory</key>
  <string>/path/to</string>
  <key>StartCalendarInterval</key>
  <dict>
    <key>Hour</key>
    <integer>2</integer>
    <key>Minute</key>
    <integer>0</integer>
  </dict>
  <key>StandardOutPath</key>
  <string>/tmp/service.log</string>
  <key>StandardErrorPath</key>
  <string>/tmp/service-error.log</string>
  <key>ProcessType</key>
  <string>Background</string>
</dict>
</plist>
Install Command
# Copy plist to LaunchAgents directory
cp com.user.service.plist ~/Library/LaunchAgents/

# Load and start the service
launchctl load ~/Library/LaunchAgents/com.user.service.plist

# Check service status
launchctl list | grep com.user.service

# To unload: launchctl unload ~/Library/LaunchAgents/com.user.service.plist

What This Tool Does

Fill in a program, a schedule, and log paths, and the generator builds a valid macOS launchd plist as live XML plus the launchctl commands to install it. Everything runs in your browser, nothing is uploaded. Watch the trap it flags: a StartCalendarInterval with no fields set matches every value, so the job fires once a minute — set at least an Hour or Minute.

Last updated:

This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.

Agent Invocation

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/launchd-plist-generator/

For automation planning, fetch the canonical contract at /api/tool/launchd-plist-generator.json.

How to Use launchd Plist Generator

  1. 1

    Create a launchd plist to run a script on schedule

    Input script path (/Users/rusty/bin/backup.sh), label (com.rusty.backup), start interval (3600 for hourly). Generator creates XML plist with proper keys. Save to ~/Library/LaunchAgents/, load with launchctl.

  2. 2

    Configure environment variables for launchd job

    If your script needs $PATH or API keys, generator's 'EnvironmentVariables' section lets you define them. Launchd won't see your shell's .zshrc, so explicit vars are crucial.

  3. 3

    Set up error logging and output redirection

    Generator adds StandardOutPath and StandardErrorPath keys. Redirect script output to /tmp/my-job.log. If job fails silently, check log file for errors. Essential for debugging.

  4. 4

    Schedule cron-like job with StartCalendarInterval

    Instead of Cron notation, launchd uses StartCalendarInterval dict (Day, Hour, Minute, Month, Weekday). Generator converts cron-like schedules to launchd format. Run daily at 2am: Generator creates proper plist.

  5. 5

    Load and test plist before permanent deployment

    After generating plist, save to LaunchAgents/ and run: launchctl load ~/Library/LaunchAgents/com.label.plist. Check if loaded with launchctl list. Verify runs at scheduled time before committing.

Frequently Asked Questions

What is launchd Plist Generator?
launchd Plist Generator is a visual tool for creating macOS launchd plist XML files. It helps you set up daemons and scheduled tasks with calendar intervals, keep-alive settings, and proper XML formatting.
How do I use launchd Plist Generator?
Fill in the form with your label, program path, schedule, and options. The tool generates valid plist XML and provides the launchctl commands needed to install and manage the service on macOS.
What is launchd and when should I use it?
launchd is the macOS system for managing background services and scheduled tasks — it replaces cron on Mac. Use it to run scripts on a schedule, at startup, or when files change.

How do I create a launchd plist for a scheduled job on macOS?

A launchd job is an XML property list that names a program, says when to run it, and where to send its output. Enter those values and the generator writes the plist for you, validating the label format and paths as you go, then gives you the launchctl commands to load it. Everything is generated in the page.

Step by step

  1. Set a reverse-DNS Label (for example com.user.backup) and the program plus its arguments.
  2. Pick a schedule type: Keep Alive, Calendar Interval, or Start Interval.
  3. For a calendar schedule, set the fields that matter and leave the rest as "Any".
  4. Add environment variables and absolute log paths for stdout and stderr.
  5. Copy the live XML or download the .plist, then run the install commands.

StartCalendarInterval fields this generator emits

Field plist key Range
Minute Minute 0–59
Hour Hour 0–23
Day of month Day 1–31
Weekday Weekday 0–6 (Sunday = 0)
Month Month 1–12

Fields and ranges as this generator emits them. Any field left as "Any" is omitted from the plist and matches all values — omit every field and the job runs each minute. (launchd also accepts Weekday 7 for Sunday; this tool uses 0.)

Keep Alive, Calendar Interval, or Start Interval?

Keep Alive writes KeepAlive and keeps a long-running daemon restarted whenever it exits. Calendar Interval writes StartCalendarInterval for cron-style scheduling on specific times. Start Interval writes StartInterval and runs the job every N seconds — for example 300 for every five minutes.

How do I load and unload the generated plist?

Copy the plist into ~/Library/LaunchAgents/ and run launchctl load; the tool prints the exact commands, including launchctl list to check status and unload to stop it. Note that this installs a per-user LaunchAgent, which runs while you are logged in; a system-wide daemon that runs at boot belongs in /Library/LaunchDaemons instead.

Does my configuration leave the browser?

No. The plist and install commands are generated client-side and never uploaded. That matters because launchd configs embed absolute paths, usernames, and environment variables — sometimes tokens or secrets — so building them locally keeps that detail on your own machine.