Last active
June 3, 2019 06:31
-
-
Save pwrliang/092b1ff42a11ffb36a8fc29e3e03ddbe to your computer and use it in GitHub Desktop.
Mac OS startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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.v2ray</string><!--这个名字必须和文件名一致, 不含.plist--> | |
<key>Program</key> | |
<string>/opt/v2ray/v2ray</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>-config</string> | |
<string>/opt/v2ray/config.json</string> | |
</array> | |
<key>KeepAlive</key><!--后台保持运行--> | |
<true/> | |
<key>RunAtLoad</key><!--加载时候运行--> | |
<true/> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
文件位置:/Library/LaunchDaemons/com.shadowsocks.plist | |
-rw------- 1 root wheel 645 Jan 30 18:32 com.shadowsocks.plist | |
命令: | |
launchctl list | |
launchctl load ~/Library/LaunchAgents/local.restart.plist | |
launchctl unload ~/Library/LaunchAgents/local.restart.plist | |
launchctl start local.restart | |
参考: | |
https://www.maketecheasier.com/use-launchd-run-scripts-on-schedule-macos/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment