This document primarily introduces how to debug on PC and preview/debug on XR devices.
All the following debugging steps are based on WebXR development unless otherwise specified.
First, prepare the debugging environment:
For extension usage instructions, refer to the Immersive Web Emulator repository
After preparation, you can preview XR projects in the editor:
Alternatively, download the project locally and preview via script build:
npm install
npm run https
HTTPS is required for WebXR, so ensure HTTPS is enabled during project debugging.
Requirements for mobile debugging:
Google Play Services for AR
is Google's augmented reality platform (ARCore). Some devices come pre-installed; if not, search in the app store. Below is an example from Xiaomi App Store:
With all conditions met, you can preview locally built projects on your phone (ensure the phone and PC are on the same local network):
Refer to Remote Debugging Android Devices. XR device debugging follows the same principle.
Before debugging, ensure Developer Options are enabled and USB Debugging is allowed on the phone.
Since XR debugging can be complex, we recommend completing most work and verification during the PC preview/debugging phase to significantly improve development efficiency.