> ## 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.

# Verify 命令

> Verify 命令

使用 `verify` 命令通过下表所示选项来验证触控适配包内容的有效性。

| 选项                                                | 说明                                                               |
| ------------------------------------------------- | ---------------------------------------------------------------- |
| `--takx`<br />`--takx-file <takx-file>`           | 您要验证的触控适配包的路径。此参数为必需。                                            |
| `--log`<br />`--log-file`<br />`--out <log-file>` | 您要将验证结果写入的文件路径。此参数为必需。                                           |
| `--default-layout <default-layout>`               | 设置预期的默认布局名称。如果提供了此参数，当默认布局与提供的布局名称不匹配时会引发验证错误。                   |
| `--layout-version <layout-version>`               | 指定触控适配包中每个布局必须兼容的语义版本。如果未指定此参数，则唯一需要的验证是所有布局都具有有效的架构版本。          |
| `--manifest-version <manifest-version>`           | 指定 manifest 架构版本必须兼容的语义版本。如果未指定此参数，则唯一需要的验证是 manifest 具有有效的架构版本。 |

### 适配包验证级别

verify 命令（以及 `pack` 和 `serve` 命令的验证阶段）会告知调用者触控适配包的任何问题。此验证过程采用以下问题分类，以帮助开发人员构建功能完备的适配包。

#### 错误

验证中的错误意味着适配包存在问题。加载适配包极有可能会失败。这些示例包括不正确或无法解析的 JSON、缺失资源或缺少 `neutral` 语言等项。除非使用 `--no-verify` 选项，否则任何错误都会阻止 `pack` 和 `serve` 命令。

#### 警告

验证警告是指示适配包可能存在问题但不阻止 `pack` 或 `serve` 命令的项。例如，包中包含但未被任何布局引用的资源会产生警告，因为这可能表明开发人员无意中包含了未发布的资源，也可能表明开发人员正在测试新资源但尚未构建所有布局，或需要更新 `allowedStateValues` 块。

<Note>警告将阻止您的 Microsoft 客户代表提交适配包的能力。</Note>

### 示例

使用以下代码示例验证触控适配包的有效性。

***

验证触控适配包并且没有错误

```
C:\>tak verify --takx-file C:\tmp\MyGameLayouts.takx
Verifying touch adaptation bundle 'C:\tmp\MyGameLayout.takx'.
Verification complete. 0 error(s) and 0 warning(s) found.
```

***

验证触控适配包并指定预期的默认布局，如果默认布局不存在则出现错误

```
C:\>tak verify --takx-file C:\tmp\MyGameLayouts.takx  --default-layout initialLayout
Verifying touch adaptation bundle 'C:\tmp\MyGameLayout.takx'.
ERROR: takxmanifest.json(1): error : Actual default layout 'menu_ui' isn't the expected default layout 'initialLayout'.
Verification complete. 1 error(s) and 0 warning(s) found.
```

## 另请参阅

[Touch Adaptation Kit 命令行工具 (tak.exe)](/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line)


## Related topics

- [Touch Adaptation Kit (TAK) 命令行工具参考](/zh-CN/build/core-features/common/game-streaming/tak-command-line-tool/index.md)
- [Pack 命令](/zh-CN/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line-pack-command.md)
- [Touch Adaptation Kit 命令行工具 (tak.exe)](/zh-CN/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line.md)
- [Create 命令](/zh-CN/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line-create-command.md)
- [License 命令](/zh-CN/build/core-features/common/game-streaming/tak-command-line-tool/game-streaming-tak-command-line-license-command.md)
