重要
Xbox 电脑工具箱应用处于预览状态。 若要了解详细信息,请联系Microsoft代表。
远程 Windows 开发 (wdRemote.exe) 是一种命令行工具,可实现在远程 Windows 设备上生成游戏所需的两个工作流。 使用以下两个命令:
- 使用 PIN 配对在开发电脑和远程设备之间建立受信任的安全连接。
- 在远程 Windows 设备上部署、启动和终止游戏。
wdRemote 在开发电脑上运行,并与远程设备上运行的 wdEndpoint.exe 实例通信。 有关 Windows 设备远程开发工具套件中的角色和wdEndpoint作用wdRemote的说明,请参阅远程 Windows 开发工具概述。
使用 Xbox 电脑工具箱 或 WinGet 在开发电脑上安装 wdRemote 。
winget install Microsoft.Gaming.RemoteIterationClient
使用 wdRemote 运行下表中列出的命令。
| 命令 | 说明 |
|---|---|
| wdRemote /action:pair | 通过 PIN 配对在开发电脑与远程设备之间建立受信任的安全连接。 |
| wdRemote /action:purgekeys | 从开发电脑中删除所有加密密钥和设备配对 |
| wdRemote /action:version | 显示 wdRemote.exe 的版本。 |
| wdRemote /action:status | 显示开发电脑与目标设备之间的连接状态。 |
| wdRemote /action:deploy | 将游戏从开发电脑部署到远程 Windows 设备。 |
| wdRemote /action:launch | 在远程 Windows 设备上启动游戏。 |
| wdRemote /action:terminate | 终止在远程 Windows 设备上运行的游戏。 |
配对远程 Windows 设备和安全密钥管理
wdRemote /action:pair
此命令通过 PIN 配对在开发电脑与远程设备之间建立受信任的安全连接。 在远程设备上运行的 wdEndpoint 生成 PIN。
wdRemote /action:pair /device:HostName | IP Address /pin:pin number
[/sshKey:filename]
| 选项 | 说明 |
|---|---|
| /action:pair | 指示 wdRemote 应执行 PIN 配对作。 |
| /装置: | 远程设备的 IP 地址或主机名。 |
| /针: | 由远程设备上运行的 wdEndpoint 实例生成的 PIN。 |
| /sshKey: | 在远程设备上安装的可选 ssh 密钥。 此密钥可用于在开发电脑和远程设备之间建立 ssh 连接。 |
示例:
// Start the pairing process by obtaining a pin using `wdEndpoint /pair` on the remote device. `wdEndpoint /pair` must be executed from a command prompt with Administrator privileges
c:>wdEndpoint /pair
wdEndpoint version: 1.0.0.0
No configuration found at 'C:\ProgramData\Microsoft GDK\wdEndpoint\wdEndpoint.json', using defaults.
Overriding security mode for pairing.
Device ID: 29aab0e953b95099388b169861940a7501c7c7be
Security Mode: Private
Game Roots:
(Default) C:\ProgramData\Microsoft GDK\gameroot
Server startup.
Listening for requests on: https://+:4275/gamingTransport/.
Entered exclusive pairing mode for 120 seconds.
PIN: q87p7w
// Specify the result PIN to the pairing /action to wdRemote on the desktop PC
c:>wdRemote /action:pair /device:myROGAllyX /pin:q87p7w
Successfully paired.
Client: a701ed911d794154737a1ed2cfe29e292d532561
Device: 231d6063b48cfc136f8ebdcad0a472edc7a27527
wdRemote /action:purgekeys
和 wdEndpoint 之间的wdRemote所有流量都已加密。
wdRemote 首次要求它连接到远程设备时,会自动创建所需的加密密钥和证书。 这些键也用于配对过程。
wdRemote /action:purgekeys 从开发电脑中删除所有密钥和设备配对。
wdRemote /action:purgekeys
状态和版本控制信息
wdRemote /action:version
显示 wdRemote.exe 的版本。
wdRemote /action:version
wdRemote /action:status
显示开发电脑与目标设备之间的连接状态。
wdRemote /action:pair 验证所有设备配对并检查以确保加密有效。
wdRemote /action:status /device:HostName | IP Address
| 选项 | 说明 |
|---|---|
| /action:status | 指示 wdRemote 应显示开发电脑与参数 /device: 标识的设备之间的连接状态 |
| /装置: | 远程设备的 IP 地址或主机名。 |
部署、启动和终止应用程序
wdRemote /action:deploy
将游戏从开发电脑部署到由 /device: 参数指定的目标设备。 所有部署都是增量部署,这意味着只有自上次部署以来已更改的文件才会传输到目标设备。
游戏存储在目标设备上名为 游戏根目录的目录中。 默认情况下,游戏根目录为 C:\%ProgramData%\Microsoft GDK\wdEndpoint\gameroot。 传递给 wdRemote 的所有目标路径都相对于游戏根目录。
可以通过创建名为 wdEndpoint.json 的文件并将其放置在 C:\%ProgramData%\Microsoft GDK\wdEndpoint\ 目标设备上来更改默认游戏根的位置,并添加其他游戏根。
wdEndpoint.json 包含以下格式的游戏根列表。
{
root:<absolute file path>,
alias:<name>,
default:true|false
}
指定 默认值 是可选的。 如果指定了多个默认值,则列出的第一个默认值将成为默认值。 如果未将根标记为默认值,列出的第一个根将变为默认值。
以下示例 wdEndpoint.json 定义两个游戏根,一 c:\developmentbuilds 个位于 的默认根,另一个在 处 d:\releasedbuilds定义一个根。
{
"gameroots": [
{
"root": "c:\\developmentbuilds",
"alias": "primary",
"default": true
},
{
"root": "d:\\releasedbuilds",
"alias": "released"
}
]
}
wdRemote /action:deploy /device:HostName | IP Address /source:directory /destination:folder under gameRoot [/root:gameRoot alias]
| 选项 | 说明 |
|---|---|
| /action:deploy | 指示 wdRemote 应执行部署作。 |
| /装置: | 远程设备的 IP 地址或主机名。 |
| /源: | 开发电脑上包含要部署的游戏的目录。 |
| /目的地: | 要在其中部署游戏的目标设备上的目录。 此方向相对于游戏根。 |
| /gameRoot: | 可选的游戏根目录。 如果未指定,将使用默认游戏根目录。 |
示例
// Deploys the contents of c:\gamesource\x64\Debug to a directory named Daily under the default game root. Using the example config file above, the game
// will be deployed to c:\developmentbuilds\Daily on the target device.
c:\>wdRemote /action:deploy /device:myROGAllyX /source:c:\gamesource\x64\Debug /destination:Daily
// Deploys the contents of \\releases\october2025\buildoutput to a directory named october2025 under the game root at d:\releasedbuilds. Using the example config file above,
// the game will be deployed to d:\releasedbuilds\october2025 on the target device.
c:\>wdRemote /action:deploy /device:myROGAllyX /source:\\releases\october2025\buildoutput /destination:october2025
wdRemote /action:launch
在由 参数指定的 /device: 远程设备上启动游戏。 启动的游戏的进程 ID 显示为输出。
wdRemote 保证一次只有一个游戏在远程设备上运行。 如果游戏在执行时 wdRemote /action:launch 已在远程设备上运行,则正在运行的游戏将在新游戏开始之前终止。
wdRemote /action:launch /device:HostName | IP Address /path:path to exe in game root [/args:list of arguments] [/root:gameRoot alias]
| 选项 | 说明 |
|---|---|
| /action:launch | 指示 wdRemote 应执行启动作。 |
| /装置: | 远程设备的 IP 地址或主机名。 |
| /路径: | 要在游戏根目录下启动的可执行文件的路径。 |
| /args: | 要传递给可执行文件的参数列表。 |
| /gameRoot: | 可选的游戏根目录。 如果未指定,则使用默认游戏根目录。 |
示例
// Launches a game in the default game root, passing a command line argument to the game
c:\>wdRemote /action:launch /device:myROGAllyX /path:Daily\Game.exe /args:"-level 2"
wdRemote /action:terminate
终止在远程设备上运行的游戏。
wdRemote /action:terminate /device:HostName | IP Address [/processid:id]
| 选项 | 说明 |
|---|---|
| /action:terminate | 指示 wdRemote 应执行终止作。 |
| /装置: | 远程设备的 IP 地址或主机名。 |
| /processid: | 要终止的进程 ID。 |
|
选项 |
说明 |
|---|---|
| /action:terminate | 指示 wdRemote 应执行终止作。 |
| /装置: | 远程设备的 IP 地址或主机名。 |
| /processid: | 要终止的进程 ID。 通常不需要 /processid 参数,因为 wdRemote /action:launch 保证一次在远程设备上只运行一个游戏。 在某些情况下,需要 /processid,例如终止游戏创建的子进程。 |