Skip to content

Instantly share code, notes, and snippets.

View KleaTech's full-sized avatar

Adam Bozzay KleaTech

View GitHub Profile
#!/usr/bin/env bash
# This script will try to find the adb remote debugging port in the specified
# IP address and then tell adb to try to connect to it.
# It is useful for connecting to an android device without opening the
# "Wireless debugging" screen to get the IP and the random port, which is
# cumbersome.
for line in $(avahi-browse --terminate --resolve --parsable --no-db-lookup _adb-tls-connect._tcp); do
if [[ $line != =* ]]; then
@cvan
cvan / oculusvr-video-setup.sh
Last active September 6, 2022 13:54
`adb` commands to call for capturing high-res videos on Oculus VR headsets
#!/bin/sh
# `adb` commands to call for capturing high-res videos on Oculus VR headsets
#
# Usage:
#
# curl https://gist.githubusercontent.com/cvan/54535a41db8a67d0370971f6e393675d/raw/c2183adf4bf0e85edc422a13599eba54e62ee473/video-setprop.sh > /tmp/oculusvr-video-setup.sh
# chmod +x /tmp/oculusvr-video-setup.sh
# ./tmp/oculusvr-video-setup.sh
#
// Each value can be set independently meaning you can change resolution without changing FPS and vice versa
// we default to(1024x1024 @ 60fps w/ 5000000 bitrate (5Mbps) in the absence of setprops
adb shell setprop debug.oculus.capture.width 1920
adb shell setprop debug.oculus.capture.height 1080
adb shell setprop debug.oculus.capture.fps 30
adb shell setprop debug.oculus.capture.bitrate 10000000
// You probably want to change the FOV to match the 1080p resolution as well:
adb shell setprop debug.oculus.eyeFovDown 39
adb shell setprop debug.oculus.eyeFovUp 38
adb shell setprop debug.oculus.eyeFovOutward 50