Preview and debug on a real device

更新时间:
复制 MD 格式

The Mini Program Integrated Development Environment (IDE) supports previewing and debugging on a real device. You can preview the output of your code or debug it on a mobile client.

Procedure

  1. Click Preview or Debug in the upper-right corner of the IDE.

    • The IDE generates a .zip package from the current code and uploads it to the console.

    • The console automatically creates a publishing task, generates a QR code, and returns the QR code to the IDE.

      Note

      If a whitelist is not set, the build may fail and a QR code cannot be generated. To resolve this issue, set a whitelist.

  2. Use a mobile client's QR code scanner to scan the QR code displayed in the IDE.

    • Scanning the code triggers the console to send the Mini Program package.

    • The QR code is valid for 15 minutes. After it expires, a refresh button appears.

  3. After the mobile client receives the Mini Program package, you can view the preview or debug interface on your device.

Set up preview and debug on a real device

See the following documents to learn how to set up real-device preview and debug for Android and iOS Mini Programs: