Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 4.16 KB

File metadata and controls

71 lines (50 loc) · 4.16 KB

Building for Meta Quest

ViroReact apps can run on Meta Quest from the same React Native codebase. This is optional: a phone AR project can win too.

Requirements

  • Expo SDK 57 and React Native 0.86. The current ViroReact release (3.0.2) installs only on this pair.
  • Node.js 22.13 or newer
  • A Meta Quest with developer mode turned on. Meta requires you to be 18 or older, to be in a developer team and to have a verified account (SMS code or a payment method) first, so do this early: see Meta's Enable developer mode guide. Then, in the Meta Horizon mobile app: headset icon → your headset → Headset Settings → Developer Mode.
  • Android Studio (it installs the Android SDK). Set ANDROID_HOME to the SDK folder (macOS: $HOME/Library/Android/sdk, Windows: %LOCALAPPDATA%\Android\Sdk) and add its platform-tools folder to your path so adb works. Without ANDROID_HOME, Gradle stops with "SDK location not found".
  • JDK 17 or 21, with JAVA_HOME pointing at it. Android Studio ships one (macOS: /Applications/Android Studio.app/Contents/jbr/Contents/Home).
  • A USB-C data cable. Plug the headset in, put it on, and choose Always allow from this computer at the USB debugging prompt. On Windows you also need the Oculus ADB driver.

From the starter kit

Already building on the starter kit? It builds for Meta Quest 3 and 3S with no code changes, and the same scenes run over passthrough. Set XR_TARGET=quest when you generate the native project (PowerShell: run $env:XR_TARGET="quest" first and drop the prefix):

XR_TARGET=quest npx expo prebuild --clean --platform android
XR_TARGET=quest npx expo run:android
  • Run Space Setup on the headset first. Plane detection reads its room scan.
  • A Quest build is its own APK. Run npx expo prebuild --clean without XR_TARGET to go back to a phone build.
  • The kit's README explains the controls and why the Geospatial demo is hidden on Quest.

Quick start (blank Expo app)

Based on ReactVision's ViroReact quickstart for Meta Quest:

npx create-expo-app@latest my-first-vr-app --template blank-typescript@sdk-57
cd my-first-vr-app
npm install @reactvision/react-viro

In app.json, add the ViroReact plugin to the expo.plugins array (create the array if there isn't one):

"plugins": [
  ["@reactvision/react-viro", { "android": { "xRMode": ["QUEST"] } }]
]
  • ["QUEST"] builds a VR-only app.
  • ["AR", "QUEST"] builds for phone AR and Quest from one project. Any build that includes QUEST is arm64 only, so test the phone side on a 64-bit Android phone.

The New Architecture is always on since Expo SDK 55, so there is no newArchEnabled setting to add.

Replace the contents of App.tsx with the VR scene from step 4 of the quickstart. Without it, the headset only shows the template's flat 2D screen. Pass your scene to ViroXRSceneNavigator as vrInitialScene; building with ["AR", "QUEST"], also pass an arInitialScene for phones.

Then build and install on the headset:

npx expo prebuild --clean --platform android
cd android
./gradlew assembleRelease      # Windows: .\gradlew.bat assembleRelease
cd ..
adb devices
adb install -r android/app/build/outputs/apk/release/app-release.apk

adb devices should list your headset. If it shows as unauthorized, put the headset on and accept the USB debugging prompt.

Your app appears in the headset's app library under Unknown Sources.

Tips

  • Keep 3D models light. The ViroReact MCP server can run a performance budget check that flags models too heavy for Quest.
  • For your demo video, record in the headset (Meta button → Camera → Record video) or cast to a phone or computer and screen-record. See SUBMISSION.md.
  • Judges don't need to own a headset. They score from your video, so make it clear.