LaunchDaemon Plist 未运行
我创建了一个 plist 文件来在登录屏幕上启动我的应用程序(10.5 和 10.6),在登录时死亡并在加载桌面时重生。如果我将 plist 文件放在 /Library/LaunchAgents 中,它会正确运行。如果我尝试从 /Library/LaunchDaemons 运行它,它不会运行。
由于这是我的第一个 Mac 应用程序,我不确定应该将 plist 文件放在哪里以及我犯了什么错误。我已将 Plist 文件的所有权设置为 root:wheel,并具有 -rw-r--r-- 权限 -
我尝试从 LaunchDaemons 运行我的应用程序是否正确,或者实际上可以从 LaunchAgents 运行吗?
我在下面附上了我的 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>KeepAlive</key>
<false/>
<key>Label</key>
<string>com.kezsoft.client</string>
<key>LimitLoadToSessionType</key>
<array>
<string>LoginWindow</string>
<string>Aqua</string>
</array>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Applications/kezsoft/kezsoftClient/Client.app/Contents/MacOS/Client</string>
</array>
</dict>
</plist>
I have created a plist file to launch my app (10.5 & 10.6)on the login screen, die when logging in and the respawn when the Desktop is loaded. If i place my plist file within /Library/LaunchAgents it runs correctly. If i try running it from /Library/LaunchDaemons it does not run.
As this is my first app for the Mac i am unsure of where i should be putting my plist file and what mistake i have made. I have set the ownership of my Plist file to root:wheel with the permissions -rw-r--r--
Am i right trying to run my app from LaunchDaemons or is it in fact ok to be run from LaunchAgents?
I have attached my plist below
<?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>KeepAlive</key>
<false/>
<key>Label</key>
<string>com.kezsoft.client</string>
<key>LimitLoadToSessionType</key>
<array>
<string>LoginWindow</string>
<string>Aqua</string>
</array>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Applications/kezsoft/kezsoftClient/Client.app/Contents/MacOS/Client</string>
</array>
</dict>
</plist>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
两者都可以,但是当您刚刚开始时,从启动代理运行会更简单,因为需要正确计算的参数较少。
更多详细信息请参阅苹果开发中心文档
Either is fine, but it's simpler to run from launchagents when your just getting started as fewer arguments need to be worked out correctly.
More details are in the apple deve centre documentation