Connect to remote TeamViewer computer desktop via MacOS terminal command line

remote desktop

How can I launch a TeamViewer remote desktop session to a remote computer from the MacOS command line, assuming that I know the Partner ID of the remote computer?

I already found documentation of command line parameters here, but there's no MacOS instructions for launching a remote session, only PC instructions. Yes, I know the document says that command line arguments work for both PC and Mac, but there's obviously no TeamViewer.exe on a Mac so I think the main question is where is the Mac equivalent to TeamViewer.exe?

BTW, I want to do this so that I can set up dock icons for each remote computer so that I can connect to them with one click on the dock, without the hassle of opening up TeamViewer to pick the remote client. After I figure out how to launch a remote desktop session from the command line, the next step will be to figure out how to launch a command line via a dock icon, but that's presumably well-documented via Google! 😉

Best Answer

To connect to Teamviewer through the command line in MacOS, pass the arguments as follow (substitute xxxxxxxx with the target id, and yyyy with the target password:

/Applications/TeamViewer.app/Contents/MacOS/TeamViewer -i xxxxxxxx -P yyyy -ac 1

-ac options:

  • 0: full access
  • 1: confirm all
  • 2: view and show
  • 3: custom
  • 9: undefined

The first time you run the command, you may be asked to allow the Terminal in your System Preferences > Security. (as well as TeamViewer itself). Just follow and enter the command again.

enter image description here