Created
February 23, 2021 13:30
-
-
Save amitkhare/9dd178e7b50da9ee9484eb57277c3909 to your computer and use it in GitHub Desktop.
opens scrcpy in WiFi mode. node - mobile needs to be connected through USB at first.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
adb.exe kill-server | |
netsh wlan show interfaces | Findstr /c:"Signal" && set "CStatus=true" || set "CStatus=false" | |
for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do set "location=%%a" | |
set location=%location:"=% | |
ping 127.0.0.1 -n 2 > nul | |
adb.exe devices | |
IF /i "%CStatus%"=="true" echo %location% | |
ping 127.0.0.1 -n 3 > nul | |
IF /i "%CStatus%"=="true" adb.exe tcpip 5555 | |
IF /i "%CStatus%"=="true" adb.exe connect %location%:5555 | |
ping 127.0.0.1 -n 1 > nul | |
IF /i "%CStatus%"=="true" scrcpy.exe --bit-rate 15M --max-size 1280 --max-fps 60 --turn-screen-off --stay-awake --show-touches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment