I am building a Mac OS app that needs to periodically grab the list of running processes. My first appraoch was to use NSTask which basicallly just executes 'ps aux'. However, after enabling app sandboxing, this broke because apparently I can't run '/bin/ps' in sandbox. I then tried listing out all running applications using 'NSWorkspace.sharedWorkspace().runningApplications' and I found that this only list user applications.
I am wondering if you guys know a way to get a list of running processes of all users (root included) that plays nicely with App Sandbox and will be approved by MAS.
If root access is required for this kind of thing, is it possible to ask for root privlege with app sandbox enabled?