Go to file
Vladimir (Alkenso) 986adf8b22
Update README.md
2022-06-23 09:21:38 +03:00
Sources/sLaunchctl Typo fix 2022-06-23 09:04:14 +03:00
.gitignore Added dependency from 'SwiftConvenience' and removed duplicated code. 2021-04-17 21:46:44 +03:00
LICENSE Initial commit 2021-04-13 17:59:19 +03:00
Package.swift Increment SwiftConvenience version 2022-06-22 19:22:23 +03:00
README.md Update README.md 2022-06-23 09:21:38 +03:00

README.md

sLaunchctl - Swift API to manage daemons and user-agents

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.

Library family

You can also find Swift libraries for macOS / *OS development

  • SwiftConvenience: 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

Examples

Bootstrap

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"))

Bootout daemon

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"))

List all daemons

let rootDaemons = try Launchctl.system.list()
let user505Agents = try Launchctl.gui(505).list()

Find many more functional inside sLaunchctl!