Uninstall TeamViewer Host from Mac mainly from terminal

By | February 18, 2021

I installed TeamViewer Host on Mac, used it and when tried to drug and drop TeamViewer Host to Trash the dialog “The item “TeamViewer Host” can’t be moved to the Trash because it’s open” was popped up. I did not find any option to quit TeamViewer Host from GUI, just I could minimize the TeamViewer Host window. Activity monitor showed me 3 running processes related to TeamViewer: one TeamViewer_Service process and 2 TeamViewer Host processes. The ps command also shows me 3 running processes related to TeamViewer:

# ps -e -o pid,command | grep -i teamviewer
73827 root /Applications/TeamViewerHost.app/Contents/MacOS/TeamViewer_Service -Module Host
73829 someuser /Applications/TeamViewerHost.app/Contents/MacOS/TeamViewer_Desktop -RunAsAgent YES -Module Host
73831 someuser /Applications/TeamViewerHost.app/Contents/MacOS/TeamViewerHost -RunAsAgent YES

The first I decided to stop TeamViewer_Service, I assumed the the service was launched as daemon, not as an agent:

# launchctl unload /Library/LaunchDaemons/com.teamviewer.teamviewer_service.plist
# launchctl unload /Library/LaunchDaemons/com.teamviewer.Helper.plist

TeamViewer_Service was gone:

# ps -e -o pid,user,command | grep -i teamviewer
73829 someuser /Applications/TeamViewerHost.app/Contents/MacOS/TeamViewer_Desktop -RunAsAgent YES -Module Host
73831 someuser /Applications/TeamViewerHost.app/Contents/MacOS/TeamViewerHost -RunAsAgent YES

Then kill TeamViewer_Desktop:

# kill -9 73829

And kill the last TeamViewerHost process:

# kill -9 73831

Now Activity Monitor did not show any TeamViewer processes and it is possible to drag and drop TeamViewer Host from Applications to Trash or simnply delete /Applications/TeamViewer\ Host folder.
Besides to do additional cleaning it was reasonable to remove the following files or folders:

# rm -f /Library/LaunchDaemons/com.teamviewer.*
# rm -f /Library/LaunchAgents/com.teamviewer.teamviewer*
# rm -f /Library/Preferences/com.teamviewer.teamviewer.preferences.plist
# rm -fR /Library/Caches/com.teamviewer.TeamViewer.RemotePrinting/
# rm -fR /Library/Application\ Support/TeamViewer\ Host/

Leave a Reply

Your email address will not be published. Required fields are marked *