My app should check if a service is currently running or not. In terminal the command would be
sudo launchctl list | grep some_service
I can't seem to be able to find any resources to create and use a privileged helper to run the protected command.
I have however found this rather rough solution, but is it safe?
Also, is it possible to just elevate the permissions of the app to just run as root everytime? If so how would I do it?