ALVR icon indicating copy to clipboard operation
ALVR copied to clipboard

Integrate ADB script for initiating a USB connection

Open zarik5 opened this issue 3 years ago • 4 comments

zarik5 avatar Mar 26 '21 22:03 zarik5

I'm posting a script I've been using to simplify launching: ALVR USB Connection.bat (I might update it, so check from time to time)

Alternatively this: https://github.com/jacklul/ALVR-USB (based on AtlasTheProto/ADBForwarder from the wiki)

It waits for specific ADB device (in this case - headset) to become connected, runs the adb forward tcp:port commands and then launches ALVR. In case for some reason the ADB connection is lost it will wait for device to be connected again - this process kills ADB server and restarts the script while keeping ALVR (and any running game) open, when device gets plugged back in it should reconnect automatically on the headset.

Requirements:

  • Followed instructions in PC part of this guide, and verified that it all works.
  • The script has to be placed in the same directory where ALVR Launcher.exe is.
  • ADB executable has to be globally available, if it's not put a path to it into adbpath.txt, e.g.: C:\ADB.
  • You have to run adb devices from the command prompt to obtain your device id and then create a file called adbdevice.txt and put the id string inside - use notepad, no extra spaces, no extra lines.

Note: adbpath.txt and adbdevice.txt must be placed where ALVR USB Connection.bat/ALVR Launcher.exe is!

Hopefully something similar could be implemented into the dashboard directly.

jacklul avatar Apr 12 '21 11:04 jacklul

I think we could use the mozdevice crate.

ckiee avatar May 19 '21 10:05 ckiee

Maybe use udev rule for this? It also may enable adb tcp which useful for sidequest

mittorn avatar Jul 28 '21 12:07 mittorn

i may work on this soon after https://github.com/alvr-org/ALVR/pull/1973

Meister1593 avatar Feb 07 '24 11:02 Meister1593