最佳答案
在 terminal
中执行 plist
文件时出错
错误: Path had bad ownership/permissions
1)我使用 xcode 6
创建了一个 plist 文件,并将 plist 文件保存在路径 library/launchdaemons/myfile.plist
中
Myfile plist
<?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>myfile</string>
<key>ProgramArguments</key>
<array>
<string>/Desktop/myscript.sh</string>
</array>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Hour</key>
<integer>14</integer>
<key>Minute</key>
<integer>35</integer>
</dict>
</array>
</dict>
</plist>
2)在终端我使用 sudo launchctl load
命令加载 plist
文件
sudo launchctl load /library/launchdaemons/myfile.plist
3)之后我得到了这个错误
/Library/LaunchDaemons/myfile.plist: Path had bad ownership/permissions
我哪里做错了?