How to stop OS X from trying to run TeamViewer every 10 seconds

launchd

I recently happened to look at my system.log file and noticed the following messages over and over:

Mar 4 12:09:32 ix com.apple.xpc.launchd[1]
(com.teamviewer.teamviewer[11506]): Service could not initialize:
Unable to set current working directory. error = 2: No such file or
directory, path = /Applications/TeamViewer.app/Contents/MacOS: 15D21:
xpcproxy + 12028 [1353][<>]: 0x2

Mar 4 12:09:32 ix com.apple.xpc.launchd[1]
(com.teamviewer.desktop[11507]): Service could not initialize: Unable
to set current working directory. error = 2: No such file or
directory, path = /Applications/TeamViewer.app/Contents/Resources:
15D21: xpcproxy + 12028 [1353][<>]:
0x2

Mar 4 12:09:32 ix com.apple.xpc.launchd[1]
(com.teamviewer.teamviewer): Service only ran for 0 seconds. Pushing
respawn out by 10 seconds.

Mar 4 12:09:32 ix com.apple.xpc.launchd[1] (com.teamviewer.desktop):
Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

TeamViewer is not installed on my Mac, and has not been for a long time. So the above is obviously looking to run something in a path that no longer exists. However, seeing launchctl involved, I ran launchctl list | grep team and lo and behold I found a couple of entries related to TeamViewer. So then I tried the following commands:

sudo launchctl stop com.teamviewer.service
sudo launchctl stop com.teamviewer.teamviewer
sudo launchctl stop com.teamviewer.Helper
sudo launchctl stop com.teamviewer.service
sudo launchctl unload /Library/LaunchAgents/com.teamviewer.teamviewer.plist
sudo launchctl unload /Library/LaunchAgents/com.teamviewer.teamviewer_desktop.plist
sudo launchctl unload /Library/LaunchDaemons/com.teamviewer.*
sudo launchctl remove /Library/LaunchDaemons/com.teamviewer.*
sudo launchctl remove /Library/LaunchAgents/com.teamviewer.*
sudo rm /Library/LaunchAgents/com.teamviewer.*
sudo rm /Library/LaunchDaemons/com.teamviewer.*

There are no more files I can find that are related to TeamViewer. Now sudo launchctl list | grep team and launchctl list | grep team both show no output, which suggests everything should be stopped and removed. But I still see the above messages every 10 seconds in system.log, even after running all those commands!

How do I make it stop?!

Best Answer

This kind of behavior is usually the result of a leftover .plist file, startup daemon or something similar. Without an uninstaller you have to root through

  • /Library/Application Support
  • /Library/LaunchAgents
  • /Library/LaunchDaemons
  • /Library/Preferences
  • /Library/StartupItems
  • ~/Library/Application Support
  • ~/Library/LaunchAgents
  • ~/Library/Preferences

for any & all related files and delete them too. If the behavior persists after all that then use the find command in Terminal to see if you can find any instances of the offending app (or sudo find if necessary) just in case there's something leftover in the normally invisible "unix-y" folders at the root level of your drive.