HELP: Privileged Helper With SMAppService

Hi! I've been developing iOS and macOS apps for many years, but now I am looking to dive into smth i have never touched before, namely privileged helpers, and i am struggling hard trying to find my footing.

Here’s my use case: I have a CLI tool that requires elevated privileges. I want to create a menu bar app that can interact with this tool, but I’m struggling to find solid documentation or examples of how to accomplish this using SMAppService. I might just be missing something obvious.

If anyone could point me toward relevant documentation, examples, articles, tutorials, or even a WWDC session that covers running privileged helpers with SMAppService, I would greatly appreciate it.

Thanks in advance!

I don’t have an easy answer for you )-: I have a bunch of resources you’ll find helpful (most notably, BSD Privilege Escalation on macOS and all the links in XPC Resources) but nothing that shows exactly how to do this.

Let’s start with some basics:

  • How far back do you want to deploy? This matters because the obvious answer here, SMAppService, requires macOS 13

  • You’re targeting direct distribution, right? This matters because App Store apps aren’t allowed to escalate privileges.

  • What is your tool doing with its elevated privileges? This matters because there may be easier options.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

HELP: Privileged Helper With SMAppService
 
 
Q