Set up Direct Preview in the Android XR Engine Hub

Applicable XR devices
This guidance helps you build experiences for these types of XR devices.
XR Headsets
Wired XR Glasses

Direct Preview Preview is a feature in the Android XR Engine Hub that lets you test and iterate on complex interactions directly inside your game engine's editor using live data from the Android XR Device. This completely bypasses the usual, time-consuming build-and-deploy cycle within XR development.

With Direct Preview, instead of exporting a full APK every time you make a change, your host machine renders and debugs the content, streams the visual viewport directly to your physical Android XR device, and streams supported OpenXR extensions back to the host machine in real-time.

Direct Preview OpenXR support

Direct Preview enables instant, low-latency testing inside your engine's viewport for the following streamed extensions:

Feature or capability OpenXR extension string

Device Anchor Persistence

XR_ANDROID_device_anchor_persistence

Raycast

XR_ANDROID_raycast

Trackables (Planes/Depth)

XR_ANDROID_trackables

Object Tracking

XR_ANDROID_trackables_object

Scene Meshing

XR_ANDROID_scene_meshing

Face Tracking

XR_ANDROID_face_tracking

Eye Tracking

XR_ANDROID_eye_tracking

Passthrough Camera State

XR_ANDROID_passthrough_camera_state

Hand Interaction

XR_EXT_hand_interaction

Get started with Direct Preview in the Android Engine Hub

Follow the steps in the following sections to enable Direct Preview, configure your physical Android XR device, and enable and start low-latency Direct Preview in your game engine:

Download and install the Android XR Engine Hub

First, download and install the latest version of the Android XR Engine Hub.

Connect and configure your Android XR device

Next, connect and configure your Android XR device for Direct Preview:

  1. Close any open game engine editors that you have running.
  2. Open the Android XR Engine Hub.

    The Device Manger screen in the Android XR Engine Hub

  3. Connect your Android XR device to your host machine using a high-quality USB-C cable.

  4. From the device drop-down menu at the top of the interface, select your connected Android XR device.

    Select the device that you want to use with Direct Preview

  5. Check that the stream client is initialized:

    1. Click Install Stream Client to deploy the necessary daemon to your headset.
    2. Click Set for Active OpenXR Runtime to redirect engine calls from the host machine to the device stream.

    Enable Direct Preview in the Android XR Engine Hub

Configure and start Direct Preview in your game engine

Finally, configure and start Direct Preview in your game engine:

  1. Complete the first-time setup and configuration steps for your game engine:

  2. Follow the steps in the "Start Direct Preview" section for your game engine each time you want to start Direct Preview: