1 Reply
      Latest reply on Aug 5, 2019 3:16 AM by eskimo
      SyamalaDutt Level 1 Level 1 (0 points)

        command and its output

         

         

            launchctl list  | grep Terminal

          

            94502 0 com.apple.Terminal.2000

         

         

        What is the 2000 number referring to?

        94502 is Pid and

        0 is exit status

         

         

        What does it mean if pid is empty _.

         

         

            _ 0 com.apple.Terminal.2000

         

         

        What is the difference between this and LaunchAgent/LaunchDaemonservices

        • Re: launchctl list shows bundle identifiers of running application, there is a number after that what is it?
          eskimo Apple Staff Apple Staff (12,475 points)

          launchctl list shows bundle identifiers of running application, there is a number after that what is it?

          With regards the number after the bundle ID, you see that for processes that are not part of the normal launchd lifecycle management (that is, things other than launch daemons, launch agents and XPC Services).  It’s a unique ID that’s used to distinguish between multiple processes with the same bundle ID.  It has no documented meaning that you can rely on.

          If you need to do something with running applications, launchctl list isn’t the answer.  There are other, better ways of getting at such information, primarily NSRunningApplication.

          If NSRunningApplication doesn’t meet your requirements, please post back with more information about those requirements.

          What does it mean if pid is empty _.

          It means the proces isn’t running.

          What is the difference between this and [launchd agent / daemon]

          A launchd daemon or agent (or XPC Service) has its lifecycle managed by launchd.  The system is aware of all the events that might cause the job to start, and monitors those events on the jobs behalf.  When such an event happens, the system starts the job which can then deal with the event.  In addition, the system will track the activity being done by the job and can terminate the job if it’s idle (typically because the system is under memory pressure).

          An application process, like Terminal, does not participate in this lifecycle.  Rather, it’s both launched and terminated by the user [1].

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

          [1] This is a bit of an oversimplification.  Recent releases of macOS can both terminate an idle app process and keep an app process running even though the user has chosen to quit it.