为什么我的配置 plist 文件没有使用 launchctl 作为服务加载?
我正在运行 OSX Yosemite,我已经阅读了这个关于使用 launchctl http://nathangrigg.net/2012/07/schedule-jobs-using-launchd/ 的优秀教程
我已经使用服务的配置创建了一个正确的 .plist 文件(我知道这是正确的,因为它几乎是我几年前创建的工作 plist 配置文件的副本)。我输入
launchctl load ~/Library/LaunchAgents/com.apple.myservice.plist
Run Code Online (Sandbox Code Playgroud)
并得到回应
~/Library/LaunchAgents/com.apple.myservice.plist: File exists
Run Code Online (Sandbox Code Playgroud)
这不是非常具有描述性,但我去打字
launchctl start com.apple.myservice
Run Code Online (Sandbox Code Playgroud)
并且没有输出,什么也没有发生。我也尝试使用
launchctl enable ~/Library/LaunchAgents/com.apple.myservice.plist
Run Code Online (Sandbox Code Playgroud)
我只是得到一个
Usage: launchctl enable <service-target>
Run Code Online (Sandbox Code Playgroud)
作为回应。
有人可以回复在 OSX Yosemite 上加载启动服务的正确语法吗?