Post

Replies

Boosts

Views

Activity

Reply to How to create a login item?
Hi, just recently I also dealt with setting a macOS app as a login item so that it starts automatically when the user logs in. So do you know a suitable way to implement a login item? Here's a solution using SMLoginItemSetEnabled to set a login item. Just follow along this tutorial, it worked fine for me and is up to date, using Swift :) theswiftdev.com/how-to-launch-a-macos-app-at-login/ Preferably it should be installed itself when the user install the application. You will create another target inside your project, so it will be installed with your main application. Keep in mind, that SMLoginItemSetEnabled can be tricky to test on your development computer (I'm speaking from personal experience). You should consider testing your app on a virtual machine with a fresh installation of macOS or on a different Mac, if testing on your development machine fails. Also make sure, to place your app in the applications folder. I hope that helps :)
Jun ’20