macos - 通过命令行 (mac) 添加启动项

标签 macos command-line startup

如何通过 Mac 上的命令行添加启动项?从谷歌搜索,我知道你必须编辑 ~/Library/Preferences/com.apple.loginitems.plist使用 defaults write com.apple.loginitems [key] [value]但我不确定要编辑哪些内容。

最佳答案

在 Mac OS X 10.6 Snow Leopard 上,它甚至比这更简单:

sudo launchctl submit -l name_of_startup_item -- 命令 [args]

man launchctl .在早期版本中,建议您创建一个 Launch Daemon PLIST文件并使用 launchctl 加载/启动它而不是创建启动项...启动项是老派的方式。

关于macos - 通过命令行 (mac) 添加启动项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2564394/

相关文章:

linux - 找不到套接字 : screen script called on startup

google-chrome - Chrome 启动时从我离开的地方继续,再多一页

postgresql - PostgreSQL启动错误: “Could not flush dirty data: Input/output error”

objective-c - 向 NSImageView 添加图像?

amazon-web-services - 将 AWS CLI "sync"结果输出到 txt 文件

macos - 无法拖放到 NSOutlineView 的整行上

android - 如何通过 USB 从 Windows 7 命令行访问 Android 文件系统

macos - 如何在 OS X 中通过命令行获取事件用户的名称?

macos - 如何全屏启动 NSWindow

reactjs - 'Invariant Violation : requireNativeComponent: "RNSScreen" was not found in the UIManager.' react native cli 错误