---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.4
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/cocos/testing.md
  - https://yandex.com/dev/games/doc/hi/sdk/cocos/testing.md
  - https://yandex.com/dev/games/doc/ko/sdk/cocos/testing.md
  - https://yandex.com/dev/games/doc/ru/sdk/cocos/testing.md
  - https://yandex.com/dev/games/doc/tr/sdk/cocos/testing.md
  - https://yandex.com/dev/games/doc/vi/sdk/cocos/testing.md
  - https://yandex.com/dev/games/doc/zh/sdk/cocos/testing.md
  - href: zh/sdk/cocos/testing.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/zh/llms.txt

# 测试

<!-- source: zh/_includes/script-common.md -->
<!-- source: zh/_includes/script/index-js.md -->

<!-- endsource: zh/_includes/script/index-js.md -->

<!-- source: zh/_includes/script/requirements-js.md -->

<!-- endsource: zh/_includes/script/requirements-js.md -->

<!-- source: zh/_includes/script/image-modal-js.md -->

<!-- endsource: zh/_includes/script/image-modal-js.md -->
<!-- endsource: zh/_includes/script-common.md -->

游戏可以从本地服务器在平台上运行，这简化了与SDK相关的功能的开发和测试。

请注意，您需要通过Yandex游戏控制台[添加游戏草稿](https://yandex.com/dev/games/doc/zh/console/add-new-game.md)。

## 构建设置 {#build-configuration}

首先，需要在面板中设置项目构建 **Project** → **Build**。

![](../../_images/cocos/testing/build.webp)

在打开的窗口中，点击 **New Build Task**，以创建新的构建配置。

配置参数。通常建议启用 **Source Maps** 和 **Debug** 项目，以简化调试。

![](../../_images/cocos/testing/edit-build-config.webp)

设置完成后，点击 **Build** 按钮以构建项目。

然后进入您的项目所在的文件夹。您将看到以下结构的文件夹：

```text showLineNumbers
Project name/
└── build/
    └── debug/
        ├── ...
        └── index.html
```

## 配置本地服务器 {#local-server-setting}

详细信息请参见[从本地服务器启动](https://yandex.com/dev/games/doc/zh/concepts/local-launch.md)部分。

### 测试 {#testing}

当本地服务器启动时，您可以使用此链接测试您的游戏，其中 XXXXXX 是您的草稿代码：

```text
https://yandex.ru/games/app/XXXXXX?draft=true&game_url=https://localhost:6577
```

如果您想测试新版本，只需在**Build**面板中重新构建项目，无需更改任何参数，并在构建完成后刷新页面。

![](../../_images/cocos/testing/rebuild.webp)


---


<!-- source: zh/_includes/button-git.md -->
<a href="https://github.com/yandex-games-plugins/cocos">
  <span class="button">存储库</span>
</a>
<!-- endsource: zh/_includes/button-git.md -->
