Mac os上App开机自动启动

这篇博客介绍了如何在Mac OS上使App支持开机自动启动。推荐使用Service Management Framework或Shared File List,前者适用于沙箱开启的应用,后者适用于沙箱未开启的应用。通过创建Helper Application并注册到系统,实现用户登录后的自动启动。文章详细阐述了每个步骤,包括Helper App的配置、Main App的修改,以及测试自动启动是否成功的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Mac OS上运行的App,想要支持用户登录后App自动启动的功能,可以使用Service Management Framework 或 Shared File List实现。对于沙箱开启的应用,苹果推荐的做法是使用Service Management Framework;对于沙箱未开启的应用,苹果推荐使用Shared File List。Service Management Framework对于沙箱未开启的APP也是可以实现登录后自动启动的。

对于Service Management framework 和 shared file list,苹果的官方解释为:

Login items installed using the Service Management framework are not visible in System Preferences and can only be removed by the application that installed them.

Login items installed using a shared file list are visible in System Preferences; users have direct control over them. If you use this API, your login item can be disabled by the user, so any other application that communicates with it it should have reasonable fallback behavior in case the login item is disabled.

使用Service Management Framework方式添加的登录项不会显示在系统偏好设置->用户与群组->登录项中,只有把应用.app文件移到废纸篓,自动启动才会失效。

使用System Preferences方式添加的登录项会显示在系

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值