> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 部署触控布局

> 部署触控布局

## 概述

[构建触控布局](/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-touch-building-touch-layout)之后，您需要在游戏中与这些布局进行交互。

## 先决条件

要部署并查看布局，您需要具备：

* 一台安装了 [Touch Adaptation Kit 命令行工具 (tak.exe)](/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line) 的 Windows PC。
* 一台运行 [Web 内容测试应用](/build/core-features/common/game-streaming/game-streaming-web-content-test-application)、[Android 内容测试应用（已弃用）](/build/core-features/common/game-streaming/game-streaming-android-content-test-application) 或 [Windows PC 内容测试应用（已弃用）](/build/core-features/common/game-streaming/game-streaming-windows-pc-content-test-application) 的设备。
* 一组您想要部署和查看的布局。

## 部署布局

### 1. 提供布局服务

在安装了 [Touch Adaptation Kit 命令行工具 (tak.exe)](/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line) 的 Windows PC 上，使用 [serve 命令](/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line-serve-command) 将布局提供给请求它们的设备。

```pwsh theme={null}
C:\Program Files (x86)\Microsoft GDK\bin>tak serve --layout-path C:\MyGameLayouts
Verifying touch adaptation bundle 'C:\MyGameLayouts '.
Now listening on: http://0.0.0.0:9269
Application started. Press Ctrl+C to shut down.
Hosting environment: Production
Content root path: C:\MyGameLayouts
```

### 2. 配置内容测试应用以加载布局

在内容测试应用的设置中，进入触控适配设置（在开发者部分）进行配置。

* 确保**启用旁加载 (Enable sideload)** 已开启。
* 输入提供布局服务的 PC 地址（包括端口）。

<Note>如果您使用 [Web 内容测试应用](/build/core-features/common/game-streaming/game-streaming-web-content-test-application) 配合 **Safari** 或者连接到运行 serve 命令的**远程 PC**，请确保旁加载地址以 `https` 开头，并使用 `--certificate-file` 选项。有关启动安全 (HTTPS) 旁加载服务器的更多信息，请参阅 [serve 命令](/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line-serve-command)。</Note>

* 如果您希望对布局所做的更改立即更新到所有已连接的客户端，请启用自动刷新（否则，只有在开始新的串流连接时才会进行更新）。

<img src="https://mintcdn.com/microsoft-4404708b/sIrPFR_ir_sNKVEv/images/gdk/features/common/game-streaming-cta-android-developer-settings.png?fit=max&auto=format&n=sIrPFR_ir_sNKVEv&q=85&s=9256baca111dbef55c2b30943854da88" alt="开发者设置" width="324" height="353" data-path="images/gdk/features/common/game-streaming-cta-android-developer-settings.png" />。

### 3. 串流您的游戏

每次串流连接时，CTA 都会连接到 TAK 服务器并下载最新的布局。

<img src="https://mintcdn.com/microsoft-4404708b/sIrPFR_ir_sNKVEv/images/gdk/features/common/game-streaming-cta-android-layout-download.png?fit=max&auto=format&n=sIrPFR_ir_sNKVEv&q=85&s=19d0d50c10717892e8456150b0afb598" alt="布局已下载" width="651" height="323" data-path="images/gdk/features/common/game-streaming-cta-android-layout-download.png" />。

请求布局时，您会在托管 `serve` 命令的 PC 上看到请求和下载。

```
C:\Program Files (x86)\Microsoft GDK\bin>tak serve --layout-path C:\MyGame\layouts
Verifying touch adaptation bundle 'C:\MyGame\layouts'.
Now listening on: http://0.0.0.0:9269
Application started. Press Ctrl+C to shut down.
Hosting environment: Production
Content root path: C:\MyGame\layouts
Request starting HTTP/1.1 POST http://192.168.1.1:9269/connection/negotiate?negotiateVersion=1  0
Request finished in 1.6283ms 200 application/json
Request starting HTTP/1.1 GET http://192.168.1.1:9269/connection?id=3u0Xs_Dlwn-J1mREHTcG5w
Request starting HTTP/1.1 GET http://192.168.1.1:9269/v1/tabs/active/download
Request finished in 3.9865ms 200 application/octet-stream
```

### 4. 选择您的布局

启动串流会话后，您可以通过点击左上角的 `...` 按钮，从游戏内叠加层中选择 Developer 然后选择 TAK 来选择要使用的触控布局。

<img src="https://mintcdn.com/microsoft-4404708b/sIrPFR_ir_sNKVEv/images/gdk/features/common/game-streaming-cta-android-select-layout.gif?s=17361970f8265532f37be519fab3ad4e" alt="选择布局。" width="460" height="217" data-path="images/gdk/features/common/game-streaming-cta-android-select-layout.gif" />


## Related topics

- [发布触控布局](/zh-CN/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-touch-publishing-layouts.md)
- [为 XBOX 游戏串流构建触控布局](/zh-CN/build/core-features/common/game-streaming/building-touch-layouts/index.md)
- [构建触控布局](/zh-CN/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-touch-building-touch-layout.md)
- [根据游戏状态更改触控布局](/zh-CN/build/core-features/common/game-streaming/building-touch-layouts/game-streaming-touch-changing-layouts-game-state.md)
- [触控入门](/zh-CN/build/core-features/common/game-streaming/game-streaming-getting-started-with-touch.md)
