Developing for macOS often assumes interaction with root daemons and user agents.
Unfortunately, Apple does not provide any actual API. (Existing SMJobXxx is deprecated)
sLaunchctl fills this gap providing convenient API that wraps up launchctl tool.
Read the article dedicated to the package: sLaunchctl — Swift API to manage Daemons and Agents
You can also find Swift libraries for macOS / *OS development
- SwiftSpellbook: Swift common extensions and utilities used in everyday development
- sXPC: Swift type-safe wrapper around NSXPCConnection and proxy object
- sMock: Swift unit-test mocking framework similar to gtest/gmock
- sEndpontSecurity: Swift wrapper around EndpointSecurity.framework
try Launchctl.system.bootstrap(URL(fileURLWithPath: "/path/to/com.my.daemon.plist"))
try Launchctl.gui().bootstrap(URL(fileURLWithPath: "/path/to/com.my.user_agent.plist"))
try Launchctl.system.bootout(URL(fileURLWithPath: "/path/to/com.my.daemon.plist"))
try Launchctl.gui().bootout(URL(fileURLWithPath: "/path/to/com.my.user_agent.plist"))
let rootDaemons = try Launchctl.system.list()
let user505Agents = try Launchctl.gui(505).list()