For those who went through the Getting Started With WebXR Series, you may be wondering how to test things. This tutorial will go through my method of testing things on Android Devices (the Oculus Quest is an Android Device too)
Let's build a web server. I like Python3, so we're going to use that. If you don't have Python3, well then figure it out
Once you have Python3, you just get yourself into the root directory of your project via the terminal, and then run python3 -m http.server 8100 --bind 127.0.0.1
and you're done. What this does is create a little web server on your localhost 127.0.0.1 over port 8100
Well we have a web server, but how do we get our Android devices to connect to it if it's running on the localhost of our computer?
Many APIs including the WebXR API require a secure context in order to work. Even though we created an http server instead of an https one, localhost is still considered a secure context, so we will use port forwarding to have our android device's localhost point to the computer's
Make sure Developer Mode is on and, depending on your device, enable USB Debugging. After that connect your device to your computer. Oculus Quest users may get a prompt in their headset to trust the connection from the connected computer, so put your headset on just in case the prompt appears
Fire up Chrome, and enter chrome://inspect/#devices
in your URL and head over there
Click on the "Port forwarding..." button and make an entry of 8100
for the Port column and localhost:8100
for the IP address and port column
When you visit a page on your Android Device's web browser, you should see it listed under the appropriate remote target on your computer via chrome and can now see logs/debug it
That's it, short and simple, the way things should be
Feeling generous/want to support me in writing tutorials? Then buy me a coffee, which I'll probably use for boba or almonds (raw and unsalted you heathens) because I don't like coffee
Comment
Please Wait...
Log in/Sign up to comment
Server error, please try again later
...