I need to be able to SSH into a Mac (Mountain Lion) and check if ARD is running and if so, what are the settings. Basically, I need the equivalent of going to System Preferences -> Sharing -> Remote Management and visually inspecting the options set there. But I need it on the Terminal so I can do this via SSH.

Note, I am not asking how to set these options (e.g. through the ARD "kickstart" executable), I am asking how, once it is running, to determine what options it is running under.

ps -axlww | grep ARD shows only /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent without any flags shown.

Is there a plist file where this is stored? So far I've checked ...


... and similar files within the user's ~/Library/Preferences/ directory, and they do not seem to contain anything useful.

2 Answers 2


You can tell if it's enabled by running launchctl list | grep '^\d.*RemoteDesktop.*'. That will output a line if there's an active process for the RemoteDesktop agent, and will output nothing if not. There's an active process for the agent whenever Remote Management is enabled, even if there's no active connection (unlike something like Screen Sharing, where the process is only active when there's a connection made).

  • This does not provide me with the options that it is being run under, though. Is there a way to find this?
    – Dave
    May 13, 2013 at 18:57
  • Not as far as I know. There may be command line utilities included with Apple Remote Desktop that could do that, but I don't know one way or another.
    – robmathers
    May 13, 2013 at 19:18
  • Ya. I'm still looking for it. I wonder if AppleScript/Objective-C is the best route to take at this point.
    – Dave
    May 14, 2013 at 17:12
  • Although it doesn't solve OP's problem, this was useful for me - thank you!
    – 2rs2ts
    Jun 11, 2013 at 21:48

I have a possible solution for you, I say 'possible' because it's not very reliable (I submitted a question on it earlier).

One other thing, you'll have to "Enable access for assistive devices", I don't know why. So here's the AppleScript:

tell application "System Preferences"
        reveal pane "com.apple.preferences.sharing"
end tell

tell application "System Events"
        set SSCBrow to 2        -- Set to the row corresponding to Screen Sharing
        tell process "System Preferences"
                set screen_sharing_toggle to value of (checkbox 1 of row SSCBrow of table 1 of scroll area 1 of group 1 of window 1) as boolean
        end tell
end tell

tell application "System Preferences"
end tell

set newvar to screen_sharing_toggle

If you save that as, say, checkScrShr you can run it from the command line as:

osascript checkScrShr

It will echo 'true' if Screen Sharing is enabled, 'false' if it isn't.

  • By "unreliable", do you mean that there are intermittent failures of the script?
    – Dave
    Jun 11, 2013 at 17:28
  • That's right: It will either tell you correctly whether or not Screen Sharing is running, or it will return an error. One other thing: the script says row 2, make sure row 2 is where your Screen Sharing is in the Sharing pane. Jun 11, 2013 at 20:20
  • @Dave I've updated the code so it's clearer Jun 11, 2013 at 21:48
  • Thanks. My experience is that there is a general issue with OS X's new security model and AppleScript. Depending on conditions outside of the Terminal environment, an AppleScript may or may not run correctly, falsely complaining about syntax errors and whatnot. Poor release engineering on Apple's part and I still haven't found a solution.
    – Dave
    Jun 13, 2013 at 21:00
  • Going back to the main issue, though, I'm looking more for a way to determine not just that it is running, but what configuration it is running with. Thanks for your AppleScript example, however, it might provide a lead.
    – Dave
    Jun 13, 2013 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .