方法一:
creat xxx.xxx.xxx.plist
12345678910111213141516<?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>xxx.xxx.xxx</string><key>ProgramArguments</key><array><string>command</string><string>parameter1</string><string>parameter2</string></array><key>RunAtLoad</key><true/></dict></plist>if you want to know the meanings of the items in the plist, please run
man launchd
&man launchd.plist
- add the plist file to
/Library/LaunchAgents/
or~/Library/LaunchAgents/
sudo launchctl load /Library/LaunchAgents/xxx.xxx.xxx.plist
方法二:
- creat xxx.xxx.xxx.plist
- Install lunchy:
gem install lunchy
lunchy install /Library/LaunchAgents/xxx.xxx.xxx.plist
lunchy start xxx.xxx.xxx.plist
方法三:
use the app Lingon
Lingon 1.2 is free, but some items of it are outdated
Lingon X 2.0 is not free.
Lingon 3 is in Mac APP Store, $10.