Tar*_*ill 5 macos xcode objective-c
我正在使用SMLoginItemSetEnabled登录时启动应用程序。一切正常,只是应用程序没有显示在“用户首选项”窗口的“登录项”下。我已经在 OS X Lion 中尝试过这个。
/Library/LaunchDaemons或 中找不到任何东西/Library/LaunchAgents。这是预期的行为。 Apple Daemons and Services Programming Guide说:
使用服务管理框架安装的登录项在系统偏好设置中不可见,只能由安装它们的应用程序删除。
是的,只需将 launchd 的 overrides.plist 中的包标识符的 Disabled 更改为 true。我给你写了一个命令来做到这一点:
/usr/libexec/PlistBuddy -c 'Set :com.yourcompany.helper-CFBundleIdentifier-here:Disabled true' /var/db/launchd.db/com.apple.launchd.peruser.$UID/overrides.plist
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2676 次 |
| 最近记录: |