Debugging ThreeJS VR on Oculus Quest 2

I just jumped into VR train with my first mindblowing headset Oculus Quest 2. I have started testing my Threejs projects and seeking for the best production workflows. If anyone could point me into the relevant resources that would be fab.

One of the first basic questions is: how can I open any debugging console to see all the errors without connecting the headset to PC.

Shall I install Android SDK and create hardware link or there is another way to do that? I do not find Firefox Reality documentation helpful.

AFAIK, this is not possible. You have to connect the VR device via USB to your computer. You can then use remote debugging with Chrome to open the (remote) dev console of Oculus browser.

You also have to enable USB debugging for Oculus Quest via the Oculus app.

1 Like

I wrote StatsVR so you didn’t need to take your headset of when trying to debug.
It doesn’t show the console output, but you can set custom properties and see them.
eg, you want to see the current value of myProperty

statsVR.setCustom1("myProperty = " + myProperty)

I’ve never tried it with oculus quest, so I cant provide any warranty of being fit for any particular purpose.

You could use try catch in your code and then setCustom1 to be the error message.

See the examples on the page for use cases.

2 Likes

Thanks for the confirmation.

The price of “special” USB-C link cable is ridiculous (£89), https://www.oculus.com/accessories/oculus-link/

I hope I do not need to install a whole Android Studio IDE and Chrome remote debugging is sufficient.

I’m using one of my USB cables of my smartphone.

Debugging via Chrome works absolutely fine. Just give it a try.

I also tried and could not get debugging to work on Quest as it is outline on the Oculus documentation. I had write some JS for the console content to appear as a dom overlay element to see logs/warning/errors. Typically I have to use Rift+Firefox for debugging webXR.

It works, indeed. On Oculus Quest 2 for Firefox-Reality (recognized as Mozilla Nightly 81.0a1) I was able to do that only in Firefox on PC.

Other browsers Chrome, Edge or Brave can detect attached/network devices but do not provide specialized inspector and console.

I finally managed that. On both ends you need Firefox-reality on Oculus and Firefox on your PC installed.

Then you need to install ADB - https://developer.android.com/studio/command-line/adb - you do not have to install entire Android Studio. Download ADB from https://developer.android.com/studio/releases/platform-tools.

You need also enable developers mode on Oculus via app on your other phone (it is so confusing), which is also tricky because before you need to create the Organization in your Oculus developer account (sic!).

Then it is so confusing when you need look into your headset and then on the PC screen. This workflow is somehow too complex for my brain. Finally I was able to see what is going on with my broken website.


Thanks. I tried that in my test project. Got some errors at the moment:

statsvr.js:22 Uncaught TypeError: Cannot read property 'parent' of undefined
at new StatsVR (statsvr.js:22)
at init (app.js:444)
at eval (app.js:80)
at Module../src/app.js (bundle.js:652)
at __webpack_require__ (bundle.js:20)
at eval (webpack:///multi_(:8080/webpack)-dev-server/client?:2:18)
at Object.0 (bundle.js:734)
at __webpack_require__ (bundle.js:20)
at bundle.js:84
at bundle.js:87
StatsVR @ statsvr.js:22
init @ app.js:444
eval @ app.js:80
./src/app.js @ bundle.js:652
__webpack_require__ @ bundle.js:20
eval @ client:2
0 @ bundle.js:734
__webpack_require__ @ bundle.js:20
(anonymous) @ bundle.js:84

(anonymous) @ bundle.js:87
client:52 [WDS] Live Reloading enabled.