LaunchAtLogin Versions Save

Add “Launch at Login” functionality to your macOS app in seconds

v5.0.1

1 month ago

v5.0.0

1 year ago

Please read carefully

macOS 13 introduced a new API to toggle “launch at login”. We now use this new API when your app is running on macOS 13 and later.

Upgrading to this version requires migration!

You need to call LaunchAtLogin.migrateIfNeeded() at launch to migrate the enabled state to the new system. You do not need to guard this call. It can be called at every app launch. It will only ever run the migration once.

For example, for a SwiftUI app, you would call it like this:

import SwiftUI
import LaunchAtLogin

@main
struct MyApp: App {
	init() {
		LaunchAtLogin.migrateIfNeeded()
	}

	var body: some Scene {
		WindowGroup {
			// …
		}
		Settings {
			Form {
				LaunchAtLogin.Toggle()
			}
		}
	}
}

You can remove this call when you think all users have ran the migration.

Make sure to verify that your app still launches at login on macOS 13.

If you need to rerun the migration for testing purposes, delete the LaunchAtLogin__hasMigrated UserDefaults key.

FAQ

What do I do later on when my app targets macOS 13

Remove the run script phase. It's no longer needed then.

You could also consider moving to my modern version of this package.


https://github.com/sindresorhus/LaunchAtLogin/compare/v4.2.0...v5.0.0

v4.0.0

3 years ago

Breaking

  • Requires Xcode 12 to build.

Improvements

Huge thanks to @SergeyKuryanov for implementing a lot of the things in this release.

v3.0.1

3 years ago
  • Don’t inherit entitlements from the main app in the helper app (#38) The helper app only needs to be sandboxed. Previously, it incorrectly inherited the sandbox entitlements of the parent app.

https://github.com/sindresorhus/LaunchAtLogin/compare/v3.0.0...v3.0.1