Teamviewer autostart on Mac OS

35,747

Solution 1

If you just want TeamViewer to start when you're logged in (including if your computer is set to automatically log in on boot), then do what CaseyIT says. If you want TeamViewer to genuinely start on boot, you need to use launchd.

First, you'll need to identify the actual executable. Open a terminal and look around in the TeamViewer bundle - the executable will likely be at /Applications/TeamViewer.app/Contents/MacOS/TeamViewer but your mileage may vary. To check you've found the right path, type it in the terminal - if TeamViewer starts, you've probably got it. Alternatively, open Activity Monitor while TeamViewer is running, identify the TeamViewer process and click 'Inspect' in the toolbar. Then, in the Open Files and Ports tab, the executable will likely be the first or second entry listed (after /).

Once you know what program you're tracking, you can create a launchd Property List. This is an XML file, so you can do it with your favourite text editor or alternatively you can use the Property List Editor that's installed with the Mac OS X Dev Tools. Create the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>some.meaningful.name</string>

    <key>OnDemand</key>
    <false/>

    <key>UserName</key>
    <string>anAppropriateUser</string>

    <key>GroupName</key>
    <string>anAppropriateGroup</string>

    <key>ProgramArguments</key>
    <array>
            <string>/path/we/identified/earlier</string>
    </array>
</dict>
</plist>

Save this in /Library/LaunchDaemons/some.meaningful.name.plist (you will need an administrator account and/or sudo), then open a terminal and do:

sudo launchctl load /Library/LaunchDaemons/some.meaningful.name.plist

This will cause launchd to load the item which will cause it to start TeamViewer on boot. As a bonus, launchd will monitor the specified program and, if it exits for any reason, it will be re-started. To get rid of the item (if you genuinely need to quit TeamViewer, for instance) simply replace load in the above command with unload.

Alternatively, Lingon provides a graphical interface to launchd, and may be easier.

Solution 2

In the account you want it to start in:

System Preferences -> Accounts - > Login Items 

Add Team Viewer to the list there.

Share:
35,747

Related videos on Youtube

Pablo
Author by

Pablo

Updated on September 17, 2022

Comments

  • Pablo
    Pablo over 1 year

    Is there any way to make TeamViewer to start upon boot?

  • HikeMike
    HikeMike over 13 years
    He wants boot, you offer login..?
  • nico gawenda
    nico gawenda over 13 years
    Scott, can you please tell us what to put in UserName and GroupName keys. Thanks Brian
  • Scott
    Scott over 13 years
    The UserName and GroupName keys are the names of the user and group of the user you want to run TeamViewer as - otherwise it will run as root, which is a bad idea. in the long term you will probably want to create a single-purpose user to run it; alternatively put your own (short) user name as the user. Unless you have particular groups set up (if you don't know, then you probably haven't) staff is the standard group for normal users on OS X.
  • nico gawenda
    nico gawenda over 13 years
    Thanks Scott. Did all that you said (tested the location, program starts from the terminal), but I get "nothing to load" as output.
  • Scott
    Scott over 13 years
    I've gone and given you the wrong path - the .plist should be saved in /Library/LaunchDaemons, not /Library/LaunchAgents. In addition, check the file is owned by root, and validate it with plutil.
  • Maxim V. Pavlov
    Maxim V. Pavlov over 12 years
    I get the Dubious file permissions warning when trying to run launchctl. And, as expected, the auto start doesn't take palce. How can I check if the root is the owner of the plist file?
  • Scott
    Scott over 12 years
    @Maxim V. Pavlov ls -l to check; chown to change.
  • martineau
    martineau over 10 years
    @MaximV.Pavlov: To clarify, you'll need to use the command sudo chown root some.meaningful.name.plist.
  • martineau
    martineau over 10 years
    Note: Teamviewr v9.0.24907 puts a com.teamviewer.teamviewer_service.plist file into the /Library/LaunchDaemons directory, so doing all this is probably unnecessary nowadays.
  • Mars Robertson
    Mars Robertson almost 6 years
    Question - after booting on the machine, I have the unlock hard disk password prompt. Do I need to disable it in order for TeamViewer autoload to work?