launchd Plist Generator
Configure Service
Leave fields as "Any" to match all values
<?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># 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
Related Tools
What This Tool Does
launchd Plist Generator is built for deterministic developer and agent workflows.
Generate macOS launchd plist files for daemons and scheduled jobs with calendar intervals, labels, and install commands.
Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.
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
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
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
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
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
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.