Until Teamviewer devices to build an option into the app that hides the dock icon, the only way to remove it is through some hacks. Since it is in the top menu bar already, I would prefer to have it not take up space in the dock. Unfortunately, doing these hacks will permanently remove the icon from the dock, even if the app is active. It’ll remain in the top menu bar though.
You can paste the following into terminal, press enter, type your account password, and press enter:
sudo bash -c 'killall TeamViewer_Service;
perl -i -0pe "s/< \/dict>\n< \/plist>/\t
LSUIElement< \/key>\n\t 1< \/string>\n< \/dict>\n< \/plist>/g" /Applications/TeamViewer.app/Contents/Info.plist;
codesign -f -s - /Applications/TeamViewer.app;
launchctl unload /Library/LaunchDaemons/com.teamviewer.teamviewer_service.plist;
launchctl load /Library/LaunchDaemons/com.teamviewer.teamviewer_service.plist'
You might get an error about the LaunchDaemons if you don’t have Unattended Access setup, but that’s okay, it’ll still work.
If you prefer to edit the file yourself, follow these steps…
First, quit TeamViewer.
Then add the following to /Applications/TeamViewer.app/Contents/Info.plist, before the final and :
Then, sign the package:
sudo codesign -f -s - /Applications/TeamViewer.app
Then, reload the TeamViewer service:
sudo launchctl unload /Library/LaunchDaemons/com.teamviewer.teamviewer_service.plist
sudo launchctl load /Library/LaunchDaemons/com.teamviewer.teamviewer_service.plist