launchk
launchk copied to clipboard
Cursive TUI that queries XPC to peek at launchd state
launchk
A Cursive TUI that makes XPC queries & helps manage launchd jobs.
Should work on macOS 10.10+ according to the availability sec. in the docs.
Install
Binaries are available via brew tap:
brew tap mach-kernel/pkgs
brew install mach-kernel/pkgs/launchk
Features
Use : to enter command mode, / to enter filtering mode, and any of sguadl for filtering by [system, global, user, agent, daemon, loaded]. Ctrl-U to clear, Tab to complete, Enter to submit.
- Poll XPC for jobs and display changes as they happen
- Filter by
LaunchAgentsandLaunchDaemonsin scopes (fsnotify watched):- System (/System/Library/)
- Global (/Library)
- User (~/)
loadunloaddumpstate(opens in$PAGER)dumpjpcategory(opens in$PAGER)procinfo(opens in$PAGER, does not require root!)editplist in$EDITORwith support for binary plistscsrinfoshow all CSR flags and their values
xpc-sys
While building launchk, XPC convenience glue was placed in xpc-sys.
[See its README here]
Credits
A big thanks to these open source projects and general resources:
- block Obj-C block support, necessary for any XPC function taking
xpc_*_applier_t - Cursive
- tokio
- plist
- notify
- bitflags
- libc
- lazy_static
- xcrun
- Apple Developer XPC services
- Apple Developer XPC API reference
- MOXIL / launjctl
- geosnow - A Long Evening With macOS' sandbox
- Bits of launchd - @5aelo
- Audit tokens explained (e.g. ASID)
- objc.io XPC guide
- Fortinet XPC RE article
- This HN comment re history
- The various source links found in comments, from Chrome's sandbox and other headers with definitions for private API functions.
- After all, it is Apple's launchd :>)
Everything else (C) David Stancu & Contributors 2021