> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-zh/mian-xiang-yi-dong-duan-gou-jian/kai-fa/preview-on-mobile.md).

# 在移动设备上预览

从 Creator Hub 或 CLI 在真实移动设备上预览你的场景。

你可以直接在 Decentraland 手机应用中，通过 Creator Hub 或命令行预览你的场景。这是唯一可靠的方法，可确认你的 UI、输入处理和性能在真机上都能正常运行。

## 前提条件

* 你的手机上已安装 Decentraland 手机应用——请参见 [下载链接](/creator/content-creator-zh/mian-xiang-yi-dong-duan-gou-jian/yi-dong-ke-hu-duan/overview.md#get-the-mobile-app).
* 手机和你的开发机器必须处于 **同一本地网络** （Wi-Fi）。预览由你的电脑提供；二维码指向一个局域网 URL。

## 选项 A——从 Creator Hub

1. 在 Creator Hub 中打开你的场景。
2. 点击 **播放** 打开按钮 **播放选项**，然后选择 **显示用于移动设备的二维码**.
3. 用手机摄像头扫描显示的二维码。该链接会打开 Decentraland 手机应用并加载你的场景预览。点击弹窗周围的深色区域即可关闭它。

<figure><img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-716e6ff7589c05f9ea2c6d87eee884b5c0c230c4%2Fmobile-preview-creator-hub.png?alt=media" alt="Creator Hub Play Options menu with the Show QR Code for Mobile option"><figcaption><p>Creator Hub 的播放选项菜单中的“为手机显示二维码”选项。</p></figcaption></figure>

## 选项 B——通过命令行

在你的场景项目根目录下运行：

```bash
npm run start -- --mobile
```

CLI 会在终端中打印一个二维码，指向你的场景的局域网 URL。用手机扫描它，即可在 Decentraland 手机应用中加载该场景。

<figure><img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-19562a6b332d4bb5254d6f2d9b92d923b3ce7069%2Fmobile-preview-cli-qr.png?alt=media" alt="QR code printed by the Decentraland CLI for mobile preview"><figcaption><p>由……打印的二维码 <code>npm run start -- --mobile</code>。用手机扫描它即可在 Decentraland 手机应用中打开场景。</p></figcaption></figure>

{% hint style="info" %}
**💡 提示**：当你传入 `--mobile`，桌面版浏览器不会同时启动。如果你想同时在两者上测试，请运行 `npm run start` 在一个终端中运行桌面版，并在 `npm run start -- --mobile` 另一个终端中运行移动版。
{% endhint %}

## 热重载

与桌面预览一样，当你更改场景文件时，移动预览会自动重新加载。你不需要在每次编辑后重新扫描二维码。

## 故障排除

* **二维码无法打开应用** ——确保已安装 Decentraland 应用，并且你已经在该设备上至少打开过一次。
* **手机无法连接到预览服务器** ——确认手机和开发机器处于同一个 Wi‑Fi 网络。有些企业网络会隔离客户端；如果是这种情况，请使用个人热点或其他网络。
* **场景在手机上加载了，但看起来与桌面版不同** ——这是预期情况。把这当作验证以下内容的时机： [安全区域](/creator/content-creator-zh/mian-xiang-yi-dong-duan-gou-jian/kai-fa/safe-area.md), [UI 尺寸](/creator/content-creator-zh/mian-xiang-yi-dong-duan-gou-jian/kai-fa/ui-best-practices.md#sizing)、以及 [输入绑定](/creator/content-creator-zh/mian-xiang-yi-dong-duan-gou-jian/kai-fa/input-on-mobile.md).

## 相关

* [预览你的场景](/creator/content-creator-zh/chang-jing-sdk7/ru-men/preview-scene.md)
* [使用 CLI](/creator/content-creator-zh/chang-jing-sdk7/ru-men/using-the-cli.md)
* [在移动端 Discover 中获得推荐](/creator/content-creator-zh/mian-xiang-yi-dong-duan-gou-jian/fa-bu/get-featured.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-zh/mian-xiang-yi-dong-duan-gou-jian/kai-fa/preview-on-mobile.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
