***英文(English)阅读***
本文适用于所有使用 15.x 软件版本和拥有 企业版或Tensor 的 TeamViewer 客户。
支持的macOS 版本为: 10.11, 10.12, 10.13, 10.14
本文讲解了如何在 macOS 操作系统版本在进行大规模部署安装,升级和卸载 TeamViewer Host 和 TeamViewer 完整版本。为了实现此目的,您需要具有有关macOS上命令行安装的基本知识。
标准主机客户端
安装标准主机客户端
所需的安装程序
- TeamViewerHost.pkg:
- 从下载Host DMG软件包。
- 从下载的DMG中提取PKG
- 如果您将DMG文件下载到Windows计算机,则可以借助一些ZIP工具(例如7ZIP)从DMG中提取PKG文件。 可以在DMG包内的“ TeamViewerHost \”文件夹中找到“ Install TeamViewerHost.pkg”包。
- 如果您将DMG软件包下载到Mac,则可以通过双击DMG软件包来解压缩“ Install TeamViewerHost.pkg”软件包。 macOS安装程序窗口将打开,您可以将“ Install TeamViewerHost.pkg”包直接拖放到桌面上。
步骤
请在终端输入以下命令行:
sudo installer -pkg "Install TeamViewerHost.pkg" -target /
参数 -target定义您要安装的路径。
静默推送安装标准主机客户端
所需的安装程序
- TeamViewerHost.pkg:
- 从下载Host DMG软件包。
- 从下载的DMG中提取PKG
- 如果您将DMG文件下载到Windows计算机,则可以借助一些ZIP工具(例如7ZIP)从DMG中提取PKG文件。 可以在DMG包内的“ TeamViewerHost \”文件夹中找到“ Install TeamViewerHost.pkg”包。
- 如果您将DMG软件包下载到Mac,则可以通过双击DMG软件包来解压缩“ Install TeamViewerHost.pkg”软件包。 macOS安装程序窗口将打开,您可以将“ Install TeamViewerHost.pkg”包直接拖放到桌面上。
步骤
- 创建一个名为(例如:choices.xml)的XML文件,然后输入以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<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>
TeamViewer版本15之前的较早版本的choiceIdentifier的名称包括TeamViewer的版本,例如:“ com.teamviewer.teamviewerhost14SilentInstaller”。 请注意,版本15已更改!
- (可选)验证您的配置是否将正确应用
- 执行以下命令
-
installer -showChoicesAfterApplyingChangesXML newChoices.xml -pkg Install\ TeamViewerHost.pkg -target /
- 这将导致输出看起来与此类似
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<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 TeamViewerHost.pkg -target /
- 如果您想部署到macOS Mojave(macOS 10.14):
- 转到您的MDM解决方案,例如 Mobile Iron,JAMF Pro,VMWare或Mirador
- 配置您的MDM以推出“可访问性”权限(根据您的MDM解决方案提供商的手册)。
可以在以下位置找到使用Mobile Iron进行MDM配置的示例:将Teamviewer应用程序添加到使用Mobile Iron的macOS Mohjave可访问性中。
安装自定义主机客户端
所需的安装程序
- TeamViewerHost.pkg:
- 从下载Host DMG软件包。
- 从下载的DMG中提取PKG
- 如果您将DMG文件下载到Windows计算机,则可以借助一些ZIP工具(例如7ZIP)从DMG中提取PKG文件。 可以在DMG包内的“ TeamViewerHost \”文件夹中找到“ Install TeamViewerHost.pkg”包。
- 如果您将DMG软件包下载到Mac,则可以通过双击DMG软件包来解压缩“ Install TeamViewerHost.pkg”软件包。 macOS安装程序窗口将打开,您可以将“ Install TeamViewerHost.pkg”包直接拖放到桌面上。
步骤
- 创建新的自定义项或打开现有的自定义项(有关详细信息,请参见如何自定义主机)
- 从您的自定义主机复制ConfigurationID
- 打开终端或通过脚本执行pkg
- 在命令行中将ConfigurationID添加到文件名:
- sudo installer -pkg“安装TeamViewerHost-idc <ConfigurationID> .pkg” -target /
参数汇总
参数
|
描述
|
-idc
|
安装自定义主机需要配置ID。 它不能用于配置完全客户端安装。 可以从管理控制台中检索配置ID。
|
静默安装自定义主机客户端
所需的安装程序
- TeamViewerHost.pkg:
- 从下载Host DMG软件包。
- 从下载的DMG中提取PKG
- 如果您将DMG文件下载到Windows计算机,则可以借助一些ZIP工具(例如7ZIP)从DMG中提取PKG文件。 可以在DMG包内的“ TeamViewerHost \”文件夹中找到“ Install TeamViewerHost.pkg”包。
- 如果您将DMG软件包下载到Mac,则可以通过双击DMG软件包来解压缩“ Install TeamViewerHost.pkg”软件包。 macOS安装程序窗口将打开,您可以将“ Install TeamViewerHost.pkg”包直接拖放到桌面上。
步骤
- 创建一个名为(例如:choices.xml)的XML文件,然后输入以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<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>
TeamViewer版本15之前的较早版本的choiceIdentifier的名称包括TeamViewer的版本,例如:“ com.teamviewer.teamviewerhost14SilentInstaller”。 请注意,版本15已更改!
- (可选)验证您的配置是否将正确应用
- 执行以下命令
-
installer -showChoicesAfterApplyingChangesXML newChoices.xml -pkg Install\ TeamViewerHost.pkg -target /
- 这将导致输出看起来与此类似
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<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 TeamViewerHost.pkg -target /
- 如果您想部署到macOS Mojave(macOS 10.14):
- 转到您的MDM解决方案,例如 Mobile Iron,JAMF Pro,VMWare或Mirador
- 配置您的MDM以推出“可访问性”权限(根据您的MDM解决方案提供商的手册)。
可以在以下位置找到使用Mobile Iron进行MDM配置的示例:将Teamviewer应用程序添加到使用Mobile Iron的macOS Mohjave可访问性中。
完整版本客户端
安装完整版本客户端
所需的安装程序
- TeamViewer.pkg:
- 从下载完整版本 DMG软件包。
- 从下载的DMG中提取PKG
- 如果您将DMG文件下载到Windows计算机,则可以借助一些ZIP工具(例如7ZIP)从DMG中提取PKG文件。 可以在DMG包内的“ TeamViewer \”文件夹中找到“ Install TeamViewer.pkg”包。
- 如果您将DMG软件包下载到Mac,则可以通过双击DMG软件包来解压缩“ Install TeamViewer.pkg”软件包。 macOS安装程序窗口将打开,您可以将“ Install TeamViewer.pkg”包直接拖放到桌面上。
步骤
- 打开终端或通过脚本执行pkg。
- 在终端中输入:sudo installer -pkg“ Install TeamViewer.pkg” -target /
sudo installer -pkg "Install TeamViewer.pkg" -target /
参数-target定义您要安装的路径。
在macOS上的安装过程中无法提供设置。
静默安装完整版本客户端
所需的安装程序
- TeamViewer.pkg:
- 从下载完整版本 DMG软件包。
- 从下载的DMG中提取PKG
- 如果您将DMG文件下载到Windows计算机,则可以借助一些ZIP工具(例如7ZIP)从DMG中提取PKG文件。 可以在DMG包内的“ TeamViewer \”文件夹中找到“ Install TeamViewer.pkg”包。
- 如果您将DMG软件包下载到Mac,则可以通过双击DMG软件包来解压缩“ Install TeamViewer.pkg”软件包。 macOS安装程序窗口将打开,您可以将“ Install TeamViewer.pkg”包直接拖放到桌面上。
步骤
- 创建一个名为(例如:choices.xml)的XML文件,然后输入以下内容:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<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>
TeamViewer版本15之前的较早版本的choiceIdentifier的名称包括TeamViewer的版本,例如:“ com.teamviewer.teamviewer14SilentInstaller”。 请注意,版本15已更改!
- (可选)验证您的配置是否将正确应用
- 执行以下命令
-
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" "">
<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 /
- 如果您想部署到macOS Mojave(macOS 10.14):
- 转到您的MDM解决方案,例如 Mobile Iron,JAMF Pro,VMWare或Mirador
- 配置您的MDM以推出“可访问性”权限(根据您的MDM解决方案提供商的手册)。
可以在以下位置找到使用Mobile Iron进行MDM配置的示例:将Teamviewer应用程序添加到使用Mobile Iron的macOS Mohjave可访问性中。
更新 TeamViewer 安装
更新TeamViewer对应于安装所需的步骤:
- 安装Teamviewer的标准主机客户端版本
- 安装Teamviewer的自定义主机客户端版本
- 安装TeamViewer的标准完整客户端版本
卸载 TeamViewer
卸载TeamViewer的原因可能是您想从TeamViewer主机客户端版本切换到完全客户端版本。
您只能手动卸载TeamViewer
建议的卸载TeamViewer的方法是使用Mac App Store中的AppCleaner:
- 从Mac App Store下载并安装AppCleaner。
- 打开AppCleaner,然后单击Finder图标。
- 在左侧菜单中,单击“应用程序”。
- 将TeamViewer应用程序拖到AppCleaner中。
- 单击删除。
- 输入密码,然后单击确定。
该程序已被卸载。
执行帐户分配
先决条件
- TeamViewer已安装。
- 启用了“从系统启动”选项。
- TeamViewer服务正在运行!
- 分配工具和应用程序一起安装在
/Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment
(/Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment)。
步骤
- (可选)使用以下命令启动TeamViewer服务进程(仅当用户通过ssh登录时才需要):
sudo launchctl load /Library/LaunchDaemons/com.teamviewer.teamviewer_service.plist
在应分配的所有设备上以sudo特权运行分配工具。 为了在大规模部署方案中执行此操作,建议您使用脚本来调用具有所需参数的分配工具。
- 主机版本
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -group <GROUP> -alias <COMPUTERNAME> -grant-easy-access
- 完整版本
sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN>
- 设备已分配给创建“自定义TeamViewer主机”模块的帐户。
- (可选)为设备激活EasyAccess
分配选项
下列表格显示了可能的分配选项(都是可选的)。有些参数需要一个值(-aliasMyAlias)或者不需要值(-reassign)。这些选项需要添加到命令行。
- 如果您的参数值带有空格(例如,组名称),请使用“ <GROUP_NAME_WITH_BLANK>”。
- sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOAPITOKEN> -group“我的群组” -alias“ $ ALIAS”
- 参数名称区分大小写
- 可以在ASSIGNMENTOPTIONS中为分配指定代理设置。 TeamViewer连接本身还有其他代理设置(在TeamViewer客户端选项中定义)。这些必须在ASSIGNMENTOPTIONS之外设置。
- 您还可以在命令中插入环境变量以进行安装/分配,以添加动态值,例如为别名。您可以使用$符号来使用环境变量。变量值中不应包含以下字符:$,@,`,´,并且变量应始终用引号引起来。
例:
1. 导出 GROUP =“ MyGroup”
2. 导出 ALIAS =“ MyDevicename”
3. sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOAPITOKEN> -group“ $ GROUP” -alias“ $ ALIAS”
选项
|
描述
|
-api-token <TOKEN>
|
API 令牌,以便完成分配工作至正确账户
|
-alias [<name>]
|
计算机和联系人列表中的新设备别名。如果该设备已在联系人列表内,则别名将被覆盖。 该参数可以采用以下值:
- -alias (without value) → 该电脑的别名将为TeamViewer ID
/Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -alias -group MyGroup
- -alias hello → 该电脑的别名将为 "hello"
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -alias hello -group MyGroup
-
alias parameter not specified → 该电脑的别名将为电脑名称
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -group MyGroup
|
-grant-easy-access
|
如果设置此选项,则在分配后可以轻松访问(与 TeamViewer 主页面的”授予轻松访问“相同)
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -grant-easy-access -group MyGroup
|
-reassign
|
分配该设备到指定账户,即使该设备已经分配至其他账户
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -reassign -group MyGroup
|
-group <name>
|
将添加设备的组的名称。 当该组不存在时,它将自动创建。 如果该设备已经存在于其他组的“计算机和联系人”列表中,则不会移至该组。
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -group MyGroup
仅在未使用自定义主机时才需要,因为已在自定义配置中定义了默认组
|
-group-id <ID>
|
如果已知该组的ID, 则此选项是使用组参数的替代。
这在非常庞大的客户环境中十分有用,因为它可以加快分配过程。通常使用 -group就足够。 请注意:组ID 必须以字母“g”开头。
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -group-id g123
|
-wait <seconds>
|
使用此参数,可以以秒为单位指定分配的等待时间。默认值30(秒)通常应该足够。
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -wait 45 -group MyGroup
|
-proxy <name>:<port>
|
您的代理 Url (仅用于分配)格式为<名字>:<端口>( <name>:<port>), 例如. --proxy yourproxy:3201
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
注意 URL without http://
|
-proxy-user <name>
|
用于对代理进行身份验证的用户名(仅用于分配)
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
|
-proxy-pw <password>
|
用于对代理进行身份验证的密码(仅用于分配)
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
|
-proxy-pw-base64 <encoded_password>
|
与 --proxy-pw一样, 但是密码需要作为 Base64 编码的字符串输入。适用于带有特殊字符的密码
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw-base64 bXlwYXNz -group MyGroup
|