---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/games/doc/en/console/debug-panel.md
  - https://yandex.com/dev/games/doc/hi/console/debug-panel.md
  - https://yandex.com/dev/games/doc/ko/console/debug-panel.md
  - https://yandex.com/dev/games/doc/ru/console/debug-panel.md
  - https://yandex.com/dev/games/doc/tr/console/debug-panel.md
  - https://yandex.com/dev/games/doc/vi/console/debug-panel.md
  - https://yandex.com/dev/games/doc/zh/console/debug-panel.md
  - href: zh/console/debug-panel.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

# Debug面板

<!-- 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 -->

Debug面板 —— 这是一个工具，您可以通过它测试草稿：追踪SDK调用，模拟差的互联网连接，取消游戏的焦点，关闭Yandex的启动画面等等。

## 启用debug面板 {#debug-panel-on}

<!-- source: zh/_includes/requirements/start-debug-panel.md -->
{% list tabs %}

- 通过开发者控制台
    1. 打开 [Yandex游戏控制台](https://games.yandex.com/console){.external}。
    1. 选择所需的游戏。
    1. 在左上角点击 **Open with debug panel**。

- 通过地址栏
    1. 打开所需的游戏。
    1. 在浏览器地址栏末尾添加 `&debug-mode=16`。

       链接示例：`https://yandex.com/games/app/XXXX?debug-mode=16`，其中 `XXXX` —— 游戏的唯一标识符。

{% endlist %}
<!-- endsource: zh/_includes/requirements/start-debug-panel.md -->

Debug面板将出现在游戏页面的左下角。

## Debug面板的组成部分 {#debug-panel-parts}

<div class="colored-header">

#|
|| [IT](#loader) | [🟢](#game-ready-call) | [⚒️](#tools-button) | [文](#i18n-button) | [▶️](#play-button) | [🎮](#gamepad-button) | [⏱️](#clock-button) ||
|#

</div>


### 加载器 {#loader}

加载器可以有以下值：

#|
|| **指示器** | **文本** | **含义** ||
|| `W` | — | 等待初始化。 ||
|| `IT` | ##Is loader: true## | SDK加载器正确初始化。 ||
|| `IF` | ##Is loader: false## | 使用的是旧的加载器。请按照[文档](https://yandex.com/dev/games/doc/zh/sdk/sdk-about.md#connect)（[条款 1.19.1](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#1-19-1)）载入SDK。 ||
|#


### Game Ready调用指示器 {#game-ready-call}

将鼠标悬停在指示器上，以了解游戏中的SDK状态和[`LoadingAPI.ready()`方法调用](https://yandex.com/dev/games/doc/zh/sdk/sdk-game-events.md#gameready)的时刻([条款1.19.2](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#1-19-2))。可以是紫色、绿色或红色：

<div class="table-25">

#|
|| **指示灯** | **文本** | **含义** ||
|| 闪烁紫色 ![](../_images/debug-panel/gra-purple.svg) | ##SDK is not initialized. Wait for "unit" call.## | 游戏等待SDK初始化。 ||
|| 闪烁紫色 ![](../_images/debug-panel/gra-purple.svg) | ##The game has initialized the SDK. Waiting for call "ready".## | 游戏已初始化SDK，现在等待调用方法`LoadingAPI.ready()`。Game Ready等待时间 – 90秒。 ||
|| 变为绿色 ![](../_images/debug-panel/gra-green.svg) | ##The game called ready after … ms.## | 方法`LoadingAPI.ready()`在指定的毫秒数后被调用。 ||
|| 变为红色 ![](../_images/debug-panel/gra-red.svg) | ##\"ready" called on timeout.## | 游戏中的Game Ready在等待90秒后未被调用。在这种情况下，认为游戏中未使用Game Ready。 ||
|#

</div>

{% cut "**为什么会显示“SDK is not defined”的错误，尽管Game Ready指示器显示SDK已经初始化了？**" %} {#error}

重要的是要正确初始化 SDK：`/sdk.js` 脚本必须在执行 [YaGames.init()](https://yandex.com/dev/games/doc/zh/sdk/sdk-about.md#use) 之前被加载。Game Ready 指示器仅注册 SDK 是否已经在游戏中[安装](https://yandex.com/dev/games/doc/zh/sdk/sdk-about.md#connect)，是否已连接所需的脚本。

{% endcut %}


### 工具按钮 SDK mocks ⚒️ {#tools-button}

#### 语言选择参数 {#lang}

这个功能允许更改游戏自动检测到的语言。

在带有语言标识的下拉列表中(例如 **En ![](../_images/debug-panel/choose-game-lang-arrow.svg)**),选择所需的语言。游戏将在新标签页中以该语言打开。

有关详细信息，请参阅游戏要求第 2.14 项的[验证方法](https://yandex.com/dev/games/doc/zh/requirements/2/14.md)。

#### 链接图标：🔗 **Game links mock is disabled** / 🔗 **Game links mock is enabled**。{#link-icon}

通过这个参数可以检查是否符合[要求项8.4.1](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#8-4-1)。如果在检查模式下，其他游戏的链接被替换为静态页面，则认为此项已满足。详见[检查方法](https://yandex.com/dev/games/doc/zh/requirements/8/4/1.md)。

要启用或禁用检查模式：

1. 分别选择 🔗 **Game links mock is disabled** 或 🔗 **Game links mock is enabled**。
2. 等待5秒钟，然后重新加载游戏。

#### 眼睛图标： 👁 **Remove the focus from the game** / 👀 **Return the focus to the game**. {#eye-icon}

点击按钮以移除或重新聚焦游戏。这对于游戏的调试和测试非常有用。

#### 火箭或乌龟图标： 🚀 **Network throttling is disabled** / 🐢 **Network throttling is enabled**. {#rocket-turtle-icon}

火箭与乌龟更改服务器响应的等待时间。点击这个按钮在不同模式之间切换：

- 在火箭模式下，服务器响应的等待时间是标准的。游戏按常规模式运行。

- 在乌龟模式下，客户端要求服务器立即响应。如果在短时间内没有收到回应，游戏会认为服务器没有响应。这种模式用于在测试游戏时模仿错误情况。例如，如果需要在网络连接不好的情况下测试游戏，或者模拟在SDK服务器未能及时回应时购买会发生的错误。

#### 货币图标： 🪙 **Currency mock is disabled** / 🪙 **Currency mock is enabled**. {#currency-icon}

这个设置模拟游戏中的货币（标题和图标）。

要检查游戏中的货币名称是否从 SDK 获取：

1. 选择 **Currency mock is enabled**。
1. 等待 5 秒钟并重新加载游戏。
1. 检查游戏中的货币名称是否更改为[模拟货币](*currency_mock)。如果货币：

    - 已更改 —— 游戏正确使用 SDK 方法来显示平台货币名称（符合游戏要求的[第 3.8 项](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#3-8)）。
    - 未更改 —— 游戏未使用显示平台货币名称的方法，违反了游戏要求的[第 3.8 项](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#3-8)。审核人员将拒绝此类游戏。需要根据[文件](https://yandex.com/dev/games/doc/zh/requirements/1/13.md#currency-detection)设置货币的标题和图标。

要返回标准货币名称，请选择 **Currency mock is disabled** 并刷新游戏页面。

#### 云图标： ☁️ **Clear cloud data** {#cloud-icon}

清除已保存的玩家数据和统计信息。

该按钮使用空值调用 [player.setData()](https://yandex.com/dev/games/doc/zh/sdk/sdk-player.md#setdata) 和 [player.setStats()](https://yandex.com/dev/games/doc/zh/sdk/sdk-player.md#setstats) 方法。

重置后，游戏将像第一次启动一样 —— 这对于测试新手引导和初始游戏体验非常方便。


### 语言指示器 文 {#i18n-button}

文 指示器帮助验证游戏中通过 [Yandex Games SDK](https://yandex.com/dev/games/doc/zh/sdk/sdk-environment.md#structure-i18n) 实现的自动语言检测是否正常工作。

#|
|| **背景** | **文本** | **含义** ||
|| ![SVG](../_images/debug-panel/i18n-on.svg) | ##I18N is used## | 已启用自动检测。 ||
|| ![SVG](../_images/debug-panel/i18n-off.svg) | ##I18N is not used## | 未启用自动检测。 ||
|#

有关详细信息，请参阅游戏要求第 2.14 项的[验证方法](https://yandex.com/dev/games/doc/zh/requirements/2/14.md)。


### 播放按钮 ▶️ {#play-button}

播放按钮是游戏活动的指示器。通过`game_api_pause`/`game_api_resume`事件，平台通知游戏何时应该暂停或继续游戏体验。

点击按钮以模拟事件操作：

- ▶️ —— 游戏在焦点中，游戏过程正在进行。
- ⏸️ —— 游戏不在焦点中，购物窗口打开或正在显示广告。

### 游戏手柄按钮 🎮 {#gamepad-button}

游戏手柄按钮 🎮 模拟使用 [SDK 方法](https://yandex.com/dev/games/doc/zh/sdk/sdk-game-events.md#gameplay) `GameplayAPI.start()` 和 `GameplayAPI.stop()`（[第1.19.3条](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#1-19-3)）。按下它以在以下状态之间切换：

- 深色背景 ![](../_images/debug-panel/gameplay-none.svg) （默认）—— 游戏中未使用游戏玩法。
- 绿色背景 ![](../_images/debug-panel/gameplay-on.svg) —— 游戏玩法正在进行中。
- 红色背景 ![](../_images/debug-panel/gameplay-off.svg) —— 游戏玩法已暂停。

### 按钮⏱️ {#clock-button}

点击⏱️图标，可切换打开或关闭 Yandex 启动屏幕的透明度：

- **Mute Game loader** —— 关闭透明度，游戏启动时会显示带有游戏图标的加载屏幕。
- **Show Game loader** —— 开启透明度，游戏的加载图标会变透明。可以查看游戏加载过程中的情况。

[*currency_mock]: 模拟货币是服务器用于测试的一种假定货币。 审核人员使用文本名称 TST 和日元图标 ¥ 作为模拟货币。