2
NSArray *activeApps = [[NSWorkspace sharedWorkspace] runningApplications];

Returns running applications and agents, but i cannot see my running XPC mach service (although it is running and visible in activity monitor processes)

even when i look up the PID in activity monitor

id res = [NSRunningApplication runningApplicationWithProcessIdentifier:223];

i get res nil, although with other processes this works well

Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179

1 Answers1

0

The NSRunningApplication documentation states:

Only user applications are tracked; this does not provide information about every process on the system

What exactly you trying to accomplish? you dont need to check for a service in this way.

Brad Allred
  • 7,323
  • 1
  • 30
  • 49
  • ok, but what exactly "user applications" means? as this xpc is run by the current user and also helpers without UI are listed... i need to know, it the XPC is running, as from the connection i cannot determine (the response for not running and denied connection is the same) – Peter Lapisu Oct 14 '14 at 15:18
  • User applications mean processes running as that user. Based on what you've described it's likely the code you're trying to monitor is running as root. – Joshua Kaplan Oct 28 '21 at 09:39