本文讲解了如何在 macOS 操作系统版本在进行大规模部署安装,升级和卸载 TeamViewer Host 和 TeamViewer 完整版本。为了实现此目的,您需要具有有关macOS上命令行安装的基本知识。
本文适用于所有使用 15.x 软件版本和拥有 专业版或Tensor 订阅许可计划的 TeamViewer 客户。支持的macOS 版本为: 10.14,10.15, 11,12,13
请在终端输入以下命令行:
sudo installer -pkg "Install TeamViewer_Host.pkg" -target /
参数 -target定义您要安装的路径。
1) 创建一个名为(例如:choices.xml)的XML文件,然后输入以下内容:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> </array> </plist>
2)(可选)验证您的配置是否将正确应用
installer -showChoicesAfterApplyingChangesXML newChoices.xml -pkg Install\ TeamViewer Host.pkg -target /
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> ... </dict> <dict> ... </dict> <dict> <key>attributeSetting</key> <false/> <key>choiceAttribute</key> <string>visible</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <true/> <key>choiceAttribute</key> <string>enabled</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> </array> </plist>
通过添加参数“-applyChoiceChangesXML <your_filename>.xml”在安装过程中应用配置
sudo installer -applyChoiceChangesXML choices.xml -pkg Install TeamViewer Host.pkg -target /
3) 如果您有 MDM 系统,则可以使用隐私首选项策略控制 (PPPC) 有效负载在系统首选项 ➜ 安全和隐私 ➜ 隐私中为 TeamViewer 推出辅助功能和完整磁盘访问权限。 您的用户仍然需要自己授予屏幕录制访问权限。 从 macOS 11 Big Sur 开始,您将需要使用带有 AllowStandardUserToSetSystemService 的 ScreenCapture PPPC 负载,以允许非管理员用户授予此权限。
配置您的MDM以推出“辅助功能”权限(根据您的MDM解决方案提供商的手册)。 可以在以下位置找到使用Mobile Iron进行MDM配置的示例:将Teamviewer应用程序添加到使用Mobile Iron的macOS Mohjave可访问性中。
1) 创建一个名为(例如:choices.xml)的XML文件,然后输入以下内容:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> </array> </plist>
2)(可选)验证您的配置是否将正确应用
installer -showChoicesAfterApplyingChangesXML newChoices.xml -pkg "TeamViewer_Host-idc<ConfigurationID>.pkg" -target /
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> ... </dict> <dict> ... </dict> <dict> <key>attributeSetting</key> <false/> <key>choiceAttribute</key> <string>visible</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <true/> <key>choiceAttribute</key> <string>enabled</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> </array> </plist>
通过添加参数“ -applyChoiceChangesXML <your_filename> .xml”在安装过程中应用配置
sudo installer -applyChoiceChangesXML choices.xml -pkg "TeamViewer _Host-idc<ConfigurationID>.pkg" -target /
3) 如果您有 MDM 系统,则可以使用隐私首选项策略控制 (PPPC) 有效负载在系统首选项➜ 安全和隐私 ➜ 隐私中为 TeamViewer 推出辅助功能和完整磁盘访问权限。 您的用户仍然需要自己授予屏幕录制访问权限。 从 macOS 11 Big Sur 开始,您将需要使用带有 AllowStandardUserToSetSystemService 的 ScreenCapture PPPC 负载,以允许非管理员用户授予此权限。
配置您的MDM以推出“辅助功能”权限(根据您的MDM解决方案提供商的手册)。 可以在以下位置找到使用Mobile Iron进行MDM配置的示例:将Teamviewer应用程序添加到使用Mobile Iron的macOS Mohjave可访问性中。
sudo installer -pkg "Install TeamViewer.pkg" -target /
⚠在 macOS 上安装过程中无法提供设置。
1) 创建一个名为(例如:choices.xml)的XML文件,然后输入以下内容:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerSilentInstaller</string> </dict> </array> </plist>
2)(可选)验证您的配置是否将正确应用
installer -showChoicesAfterApplyingChangesXML newChoices.xml -pkg Install\ TeamViewer.pkg -target /
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> ... </dict> <dict> ... </dict> <dict> <key>attributeSetting</key> <false/> <key>choiceAttribute</key> <string>visible</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <true/> <key>choiceAttribute</key> <string>enabled</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerSilentInstaller</string> </dict> </array> </plist>
通过添加参数“ -applyChoiceChangesXML <your_filename> .xml”在安装过程中应用配置
sudo installer -applyChoiceChangesXML choices.xml -pkg Install TeamViewer.pkg -target /
3) 如果您有 MDM 系统,则可以使用隐私首选项策略控制 (PPPC) 有效负载在系统首选项 ➜ 安全和隐私 ➜ 隐私中为 TeamViewer 推出辅助功能和完整磁盘访问权限。 您的用户仍然需要自己授予屏幕录制访问权限。 从 macOS 11 Big Sur 开始,您将需要使用带有 AllowStandardUserToSetSystemService 的 ScreenCapture PPPC 负载,以允许非管理员用户授予此权限。
配置您的MDM以推出“辅助功能”权限(根据您的MDM解决方案提供商的手册)。 可以在以下位置找到使用Mobile Iron进行MDM配置的示例:将Teamviewer应用程序添加到使用Mobile Iron的macOS Mohjave可访问性中。
更新TeamViewer 对应于安装所需的步骤:
卸载TeamViewer 的原因可能是您想从TeamViewer 主机客户端版本切换到完全客户端版本。
📌注意:您只能手动卸载TeamViewer
建议的卸载TeamViewer 的方法是使用Mac App Store中的AppCleaner:
该程序已被卸载。
主机版本:
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -group <GROUP> -alias <COMPUTERNAME> -grant-easy-access
Full version:
sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN>
下列表格显示了可能的分配选项(都是可选的)。有些参数需要一个值(-aliasMyAlias)或者不需要值(-reassign)。这些选项需要添加到命令行。
Option - 选项
Description - 描述
-api-token <YOUR_APITOKEN>
API Token in order to do the assignment to the correct account
-alias [<name>]
Alias for the new device in the computers & contacts list. If the device is already in the contact list, no alias will be applied. The parameter can take the following values:
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -alias -group MyGroup
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -alias hello -group MyGroup
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -group MyGroup
If you set this option, easy access is granted after the assignment (same as the "Grant easy access" option in the TeamViewermain window).
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -grant-easy-access -group MyGroup
Assigns the device to the account even if the device is already assigned to an account.
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -reassign -group MyGroup
Name of the group to which the device will be added.
When the group doesn't exist, it will be automatically created.
If the device is already in the computers & contacts list in a different group, it won't be moved to the group.
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -group MyGroup
Only required if no custom host is used, as a default group is already defined in the custom configuration.
This option is an alternative to using the --group parameter if the group's id is known.
This might be useful in large customer environments as it speeds up the assignment process. Usually, using --group is sufficient.
Note that the ID must be prepended with a literal "g".
sudo /Applications/TeamViewer (Classic)Host.app/Contents/Helpers/TeamViewer (Classic)_Assignment -api-token <YOUR_APITOKEN> -group-id g123
With this parameter, the waiting time for the assignment can be specified in seconds. The default value of 30 (secs) should usually be sufficient.
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -wait 45 -group MyGroup
Url of your proxy (only for the assignment) in the format <name>:<port>, e. g. --proxy yourproxy:3201
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
🚨注意: URL without http://
Username which is used for authentication against the proxy (only for the assignment).
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
Password which is used for authentication against the proxy (only for the assignment).
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
Same as --proxy-pw, but the password needs to be entered as a Base64 encoded string. Useful for passwords with special characters.
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw-base64 bXlwYXNz -group MyGroup