Contents

SMAppService

An object the framework uses to control helper executables that live inside an app’s main bundle.

Declaration

class SMAppService

Overview

In macOS 13 and later, use SMAppService to register and control LoginItems, LaunchAgents, and LaunchDaemons as helper executables for your app. When converting code from earlier versions of macOS, use an SMAppService object and select one of the following methods depending on the type of service your helper executable provides:

  • For SMAppServices initialized as LoginItems, the register() and unregister() APIs provide a replacement for SMLoginItemSetEnabled(_:_:).

  • For SMAppServices initialized as LaunchAgents, the register() and unregister() methods provide a replacement for installing property lists in ~/Library/LaunchAgents or /Library/LaunchAgents.

  • For SMAppServices initialized as LaunchDaemons, the register() and unregister() methods provide a replacement for installing property lists in /Library/LaunchDaemons.

Topics

Registering services

Managing apps

Interacting with System Settings

Getting the state of the service

Checking authorization for earlier OS version login items

See Also

Management