Skip to content

Instantly share code, notes, and snippets.

@dineshmm23
Created June 11, 2019 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dineshmm23/872ad24370655475e41aac0faa0e0c25 to your computer and use it in GitHub Desktop.
Save dineshmm23/872ad24370655475e41aac0faa0e0c25 to your computer and use it in GitHub Desktop.
Initilisation of Variables. Put your defualts in here. Change enableSetVariablesWarning to anything else to disable warning
@echo off
:: Initilisation of Variables.. Put your defualts in here
:: Change enableSetVariablesWarning to anything else to
:: disable warning
set defaultIp="192.168.10.104"
set adbLoc="D:\Android_sdk\sdk\platform-tools"
set enableSetVariablesWarning="true"
set askForIP="false"
:: End of Initiation
if /I %enableSetVariablesWarning%=="true" GOTO COMMENT
GOTO ENDOFCOMMENTS
:COMMENT
@echo 01010101010101010101010101 CONFIG 01010101010101010101010101
@echo Is This your first time using this bat?
@echo make sure that you have configured:
@echo defaultIp: %defaultIp%
@echo adbLoc: %adbLoc%
@echo askForIP: %askForIP%
@echo change "enableSetVariablesWarning" to anything other than
@echo true to disable this warning
@echo 01010101010101010101010101 CONFIG 01010101010101010101010101
@echo.
:ENDOFCOMMENTS
@echo Make sure that the Android is connected
if /I %askForIP%=="true" GOTO GETIP
set ip=%defaultIp%
GOTO CONNECT
:GETIP
set ip="invalid"
set /p ip="Enter IP(default=192.168.10.104): " %=%
if /I %ip%=="invalid" GOTO SETIP
GOTO CONNECT
:SETIP
set ip=%defaultIp%
@echo Defaulting the ip to: %ip%
:CONNECT
set curr_dir=%cd%
chdir /D %adbLoc%
@echo Restarting adb
adb kill-server
adb tcpip 5555
@echo Connecting to %ip%
adb connect %ip%:5555
adb devices
chdir /D %curr_dir%
set /p ip="Press Enter to Exit" %=%
@dineshmm23
Copy link
Author

Hi guys , Help these gist to improve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment