Oculus Quest 2 with a link cable and a red cross over the cable

Connect ADB wirelessly to a Oculus Quest

Update 2024-10-10: The easiest way is to install Meta Developer Hub, connect your heaset, and press the ADB over Wi-Fi switch under Device Manager.


When developing VR games and experiences for my Oculus Quest and Quest 2, I often wanna export an .apk file to the headset to check performance or just be untethered from my computer. Usually I transfer it using a Link cable (just a fancy USB 3 cable), but it’s a bit of a hazel having a cord connected all the time. But recently I learned you can connect through ADB using a WIFI connection!

Here’s the steps to connect to your Quest over WIFI:

(I also provide some .bat files for Windows user so you don’t need to type and remember this every time):

  1. Connect your headset with a USB 2 or 3 data transfer cable (like the official Link cable), take on your headset and accept any incoming connection in your headset.
  2. Make sure the headset and computer is connected to the same WIFI-network.
  3. Get the IP address of the headset: In your terminal where you have adb (Android Device Bridge) installed (in Windows this is the Command Prompt), you can write adb devices to see if your device is conencted to your computer, and then write adb shell ip addr show wlan0. After the text inet you will see your device IP adress, ex 192.168.1.2.
  4. Now restart adb with port 5555: adb tcpip 5555
  5. Lastly we want to connect the device to this connection: adb connect 192.168.1.2:5555.

Now you can remove the cable and enjoy sending new builds from ex Unity to your device, cable free!

Bonus content:

Show IP address and connect it to ADB using TCP/IP using an interative .bat file

Make sure the path to your SDK platforms-tools is correct* (usually it’s just to change the Unity version to the one you have installed), and copy this code inside a text file and save it as “connectWirelesslyToAndroidDevice.bat” and put in your project or Desktop:

cd C:\Program\Unity\Hub\Editor\2020.2.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\ && adb devices && adb shell ip addr show wlan0
set /p IpAddress=What is the devices IP address?
adb tcpip 5555
adb connect %IpAddress%:5555
echo If no error, you may now remove the cable and close this window
cmd /k

Now you can just double-click the file, copy the IP-address, paste it and press enter to confirm. Much faster then needing to write everything yourself all the time.

* This is so that you have the same ADB server running as Unity is using. If you ever seen this message, you know what I mean:

adb server version (40) doesn't match this client (41); killing...


Posted

in

by

Tags:

Comments

6 responses to “Connect ADB wirelessly to a Oculus Quest”

  1. roy edwards Avatar
    roy edwards

    can you please help me bypass the control set up screen ,my son’s controller has stopped working

    1. Jonas Sandstedt Avatar
      Jonas Sandstedt

      Sorry for late reply, I hope you manage to fix this already. But if the controller isn’t working, it’s either out of battery or broken (if it’s been smashed into a wall or similar).

      But nowadays you can use handtracking in the onboarding screen on your quest, so no need for controllers there if they don’t show up for some reason.

  2. Azam Avatar
    Azam

    Thank you for the bonus content 🙂

    1. Jonas Sandstedt Avatar
      Jonas Sandstedt

      You’re welcome!

  3. Gary Vick Avatar

    Hi I am a programmer, using Quest2, I am trying to use android intent call to start unity openxr based application… it works fine with 2D mode unity application but not with OpenXR+Unity…
    I am now starting to use adb driver instead… but hoping some trick with android “intent” call would work… Best,
    Gary

    1. Jonas Sandstedt Avatar

      If you “Build and run”, or “Patch and run” from withing Unity when in development mode, it will automatically launch the .apk. But I assume you wanna do it outside of Unity?

      Else make sure you have these lines in your tag in AndroidManifest.xml:

      ```
      <activity android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:excludeFromRecents="true" android:exported="true">
      <intent-filter>
      <action android:name="android.intent.action.MAIN" />
      <category android:name="android.intent.category.LAUNCHER" />
      <category android:name="com.oculus.intent.category.VR" />
      </intent-filter>
      <meta-data android:name="com.oculus.vr.focusaware" android:value="true" />
      </activity>

      ```

Leave a Reply

Your email address will not be published. Required fields are marked *