# Debugging ThreeJS VR on Oculus Quest 2

**URL:** <https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561>\
**Category:** Questions\
**Tags:** oculus, vr, firefox-reality\
**Created:** [December 13, 2020, 11:20pm UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561 "2020-12-13T23:20:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylwesterdigital](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sylwesterdigital/32/11792_2.png) [@sylwesterdigital](https://discourse.threejs.org/u/sylwesterdigital)\
**Post date:** [December 13, 2020, 11:20pm UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561/1 "2020-12-13T23:20:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [December 14, 2020, 9:41am UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561/2 "2020-12-14T09:41:10Z")

</div>

> [@sylwesterdigital](#):
>
> without connecting the headset to PC.

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.

---

<div class="post-metadata">

**Author:** ![seanwasere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/seanwasere/32/20864_2.png) [@seanwasere](https://discourse.threejs.org/u/seanwasere)\
**Post date:** [December 14, 2020, 10:45am UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561/3 "2020-12-14T10:45:29Z")

</div>

I wrote [StatsVR](https://github.com/Sean-Bradley/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.

---

<div class="post-metadata">

**Author:** ![sylwesterdigital](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sylwesterdigital/32/11792_2.png) [@sylwesterdigital](https://discourse.threejs.org/u/sylwesterdigital)\
**Post date:** [December 15, 2020, 1:02pm UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561/4 "2020-12-15T13:02:52Z")

</div>

Thanks for the confirmation.

The price of “special” USB-C link cable is ridiculous (£89), [https://www.oculus.com/accessories/oculus-link/](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.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [December 15, 2020, 1:08pm UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561/5 "2020-12-15T13:08:42Z")

</div>

> [@sylwesterdigital](#):
>
> The price of “special” USB-C link cable is ridiculous (£89),

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

> [@sylwesterdigital](#):
>
> I hope I do not need to install a whole Android Studio IDE and Chrome remote debugging is sufficient.

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

---

<div class="post-metadata">

**Author:** ![FuzzyWobble](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fuzzywobble/32/15221_2.png) [@FuzzyWobble](https://discourse.threejs.org/u/FuzzyWobble)\
**Post date:** [December 15, 2020, 7:18pm UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561/6 "2020-12-15T19:18:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sylwesterdigital](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sylwesterdigital/32/11792_2.png) [@sylwesterdigital](https://discourse.threejs.org/u/sylwesterdigital)\
**Post date:** [December 15, 2020, 10:55pm UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561/7 "2020-12-15T22:55:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sylwesterdigital](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sylwesterdigital/32/11792_2.png) [@sylwesterdigital](https://discourse.threejs.org/u/sylwesterdigital)\
**Post date:** [December 15, 2020, 11:06pm UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561/8 "2020-12-15T23:06:50Z")

</div>

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](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](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.

 ![Screenshot 2020-12-15 223636](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/3/3f8fe9c223d73027c6e5e122d22d63699fa75342.jpeg)  
 ![Screenshot 2020-12-15 222323](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/8/88681178efc57e9e7b3d436d3a5100b309e3e08d.jpeg)

---

<div class="post-metadata">

**Author:** ![sylwesterdigital](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sylwesterdigital/32/11792_2.png) [@sylwesterdigital](https://discourse.threejs.org/u/sylwesterdigital)\
**Post date:** [December 15, 2020, 11:47pm UTC](https://discourse.threejs.org/t/debugging-threejs-vr-on-oculus-quest-2/21561/9 "2020-12-15T23:47:26Z")

</div>

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.
