当我尝试从中加载LaunchAgent plist时,launchctl
找不到在主目录中运行脚本的方法。
我的代码是:
<?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>ProgramArguments</key>
<array>
<string>bash</string>
<string>~/script.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>Label</key>
<string>com.tyilo.test</string>
</dict>
</plist>
我已经尝试过使用bash和不使用bash,也都用替换~
过$HOME
。我也尝试过使用bash -c
它而不工作。
错误代码为:
`com.tyilo.test: bash: ~/script.sh: No such file or directory`