@echo off
set SCRCPYPATH="scrcpy"
cd %SCRCPYPATH%

adb version
echo 仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
echo 仭仭 Quest to PC 儈儔乕儕儞僌昞帵 (wifi宱桼)仭仭
echo 仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭
echo Quest偲PC傪USB愙懕偟偰 Enter僉乕 傪墴偟偰偔偩偝偄
pause

adb kill-server
adb start-server

adb tcpip 5555
timeout /t 3

REM adb shell ip route偺弌椡傪曄悢偵愝掕
for /f "tokens=9 delims= " %%i in ('adb shell ip route ^| findstr /r "link src"') do set IPADRESS=%%i

echo IP傾僪儗僗傪庢摼偟傑偟偨: %IPADRESS%

adb connect %IPADRESS%:5555
adb devices
echo ----------------------------------------------

echo Quest偐傜USB働乕僽儖傪敳偄偰 Enter僉乕 傪墴偟偰偔偩偝偄
echo 仸 働乕僽儖傪敳偄偰偄側偄応崌偼昞帵偵幐攕偡傞偺偱嵞搙偙偺bat僼傽僀儖傪幚峴偟偰偔偩偝偄
pause

scrcpy.exe --crop=2064:2208:2064:100 --window-title='Quest3Cast' --rotation-offset=-22 --scale=195 --position-x-offset=-520 --position-y-offset=-490 --video-bit-rate=8M --max-fps=30 --video-codec=h265 --display-buffer=50