LaunchDaemon Plist 未运行

发布于 2024-09-25 13:38:58 字数 1164 浏览 2 评论 0原文

我创建了一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

握住我的手 2024-10-02 13:38:58

我尝试运行我的应用程序是否正确?
LaunchDaemons 或者实际上可以
从 LaunchAgents 运行?

两者都可以,但是当您刚刚开始时,从启动代理运行会更简单,因为需要正确计算的参数较少。

更多详细信息请参阅苹果开发中心文档

Am i right trying to run my app from
LaunchDaemons or is it in fact ok to
be run from LaunchAgents?

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文