-
Notifications
You must be signed in to change notification settings - Fork 340
Description
I have a Dart-based macOS service that offloads some work to a native FFI plugin. The plugin requires root privileges to perform some tasks. When the service is properly installed in /Library/LaunchDaemons, it runs with root privileges and functions correctly. However, when launching the service in the VS code debugger, those tasks fail because the debug session is not privileged.
From the VS code level, it seems the answer to this problem is either:
(1) Launch VS code as superuser. Running apps as root in macOS rarely works besides being frowned upon and I've encountered basic debugging issues trying to do so.
(2) Farm it off to the extension. I've found that the Go extension supposedly has an "asRoot" setting for launch.json configurations though I haven't confirmed that.
I propose adding a Dart Code launch config setting to launch a debug session with sudo. A reasonable prerequisite is adding the user to sudoers to avoid any password prompts (we develop this way with Xcode).