Make Swift Cocoa app launch on startup on OS X 10.11

后端 未结 2 1979
一向
一向 2021-01-30 18:06

I need to write a function that adds my application to Startup items on OS X 10.11. That\'s what I found at the moment:

func applicationIsInStartUpItems() ->          


        
2条回答
  •  有刺的猬
    2021-01-30 18:43

    You have to use the Service Management framework now. You create a helper application that you add to your application bundle and its job is to run code to launch your main application. Some resources for you:

    • Tim Schröder has an excellent blog post on how this is done
    • Alex Zielenski has an open source project to aid with this
    • I've made a video tutorial on creating it manually

提交回复
热议问题