Skip to content

Instantly share code, notes, and snippets.

@blixt
Last active February 12, 2024 14:06
Show Gist options
  • Save blixt/1e57de3739a669b8a58395ca07ec5ad0 to your computer and use it in GitHub Desktop.
Save blixt/1e57de3739a669b8a58395ca07ec5ad0 to your computer and use it in GitHub Desktop.
Streaming Oculus Quest wirelessly over WiFi to macOS (on a MacBook)

Streaming an Android-based VR headset to your computer

Setting it up the first time

The first time you have to set it up with a cable. The Oculus Quest has a USB-C port (the one used for charging). Use this to connect to your computer.

Preparing your Oculus Quest

Your Quest needs to be in Developer mode. This is super easy, just open your companion app on your phone and go to Settings and enable Developer mode. You may need to create an organization first on the Oculus website. You can enter any name you want for the organization.

Installing everything

First you need Homebrew on your system. It's a utility that lets you install a lot of tools from the Terminal. Follow the instructions on https://brew.sh/ (just paste the line they suggest into Terminal).

Next, in Terminal:

  1. Run brew cask install android-platform-tools (Android developer tools)
  2. Run brew install scrcpy (the streaming tool)

(Tip: To launch Terminal, press ⌘+Space to show Spotlight, write "Terminal", then hit Return.)

Connecting Quest to computer

  1. Connect Quest to your computer with cable
  2. In Terminal, run adb devices and make sure you allow computer within the Quest

Next, to enable wireless connections you need to:

  1. Make sure your computer and Quest are on the same WiFi!
  2. Run adb tcpip 5555 to enable wireless connections
  3. Run adb shell ip route to get the IP of your Quest
  4. Unplug the Quest from your computer
  5. Run adb connect <IP>:5555 (replace <IP> with the IP from step 3) to connect to the Quest wirelessly

Streaming video

Just run scrcpy on the Terminal! There are cropping options that you can play with to only show one eye, etc.

Try scrcpy -b 25M -c 1440:1540:60:60 to start. You can play with the numbers after -c (width : height : x : y).

@TechnicalRexical
Copy link

TechnicalRexical commented Nov 1, 2020

https://github.com/Genymobile/scrcpy/blob/master/README.md

Like to how to use Scrcpy and it's settings.

Here: -b 25M is the Bit rate, -c 1400:1540: (default Quest 2 resolution) 60:60
I recommend changing the bitrate to 30M for the Quest 2.

Recording
It is possible to record the screen while mirroring:

scrcpy --record file.mp4
scrcpy -r file.mkv
To disable mirroring while recording:

scrcpy --no-display --record file.mp4
scrcpy -Nr file.mkv

interrupt recording with Ctrl+C

@sirotaku
Copy link

sirotaku commented Nov 4, 2020

Thanks for the guide. While, I think scrcpy -c 1400:1500:160:180 could be better to crop the screen.

@FotisK
Copy link

FotisK commented Sep 28, 2022

thanks! worked beautifully!
A couple updates needed perhaps (running macOS Monteray) -not sure where to post them:

% brew cask install android-platform-tools
Error: brew cask is no longer a brew command. Use brew --cask instead.

this worked instead:
brew install android-platform-tools

also scrcpy -c for cropping (eg. scrcpy -b 25M -c 1440:1540:60:60) no longer works. --crop worked instead:
scrcpy -b 25M --crop 1440:1540:60:60

@sikaar
Copy link

sikaar commented Jun 18, 2023

Not sure why but "adb shell ip route" provides 2 ips when using a quest pro,

the correct one to use is the first one ( dev wlan0 proto kernel scope link src 168.xx.xx.xx)
and not the second one (dev p2p-wlan0-1 proto kernel scope link src 168.xx.xx.xx - which is by the way the one displayed in Sidequest - might explain why it is not working automatically as it is picking the wrong address)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment