我如何在.net core中以编程方式告诉MacOS Catalina在系统启动时启动我的控制台应用程序?我知道我可以通过首选项手动添加程序:
Open System Preferences.
Go to Users & Groups.
Choose your nickname on the left.
Choose Login items tab.
Press “+” and choose the app you’d like add.
Then restart your Mac to see the changes.
但是如何以编程方式执行此操作呢?这在 .net core/zsh 脚本中可能吗?
最佳答案
您需要将应用程序的 plist
添加到用户的 LaunchAgents
文件夹中。 Mac 上的路径是 /Library/LaunchAgents
。
如果您希望它在用户登录 Mac 之前启动,您可以将其添加到位于以下位置的 LaunchDaemons
文件夹:/Library/LaunchDaemons
关于c# - 注册 c# .net core 控制台应用程序以在 macOS 上的系统启动时启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63386306/