XR

Debugging XR Interactions

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.

PC Debugging

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:

image.png

Alternatively, download the project locally and preview via script build:

npm install  
npm run https  
image.png

HTTPS is required for WebXR, so ensure HTTPS is enabled during project debugging.

Mobile 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:

image.png

With all conditions met, you can preview locally built projects on your phone (ensure the phone and PC are on the same local network):

image.png

Debugging

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.

Best Practices

Since XR debugging can be complex, we recommend completing most work and verification during the PC preview/debugging phase to significantly improve development efficiency.

Was this page helpful?