Skip to content

Instantly share code, notes, and snippets.

@felipebaltazar
Created August 24, 2018 13:43
Show Gist options
  • Save felipebaltazar/3b2e3388aae2801e71867db9bf58a042 to your computer and use it in GitHub Desktop.
Save felipebaltazar/3b2e3388aae2801e71867db9bf58a042 to your computer and use it in GitHub Desktop.
Bat to restart adb server
@echo off
echo ===========Adb server restart script===========
echo Author: Felipe Baltazar
echo Github:https://github.com/felipebaltazar
echo Creation Date: 24/08/2018
echo.
echo.
echo ====================Status=====================
echo Checking adb default path...
call CD %HomePath%\AppData\Local\Android\sdk\platform-tools
echo.
if %ERRORLEVEL% == 0 goto :restartAdb
echo ====================Status=====================
echo Error.. Exited with status: %errorlevel%
echo ->You need abd to continue...
echo.
goto :endfail
:restartAdb
echo ====================Status=====================
echo Status:Restarting adb server
adb kill-server
adb start-server
echo.
goto :endsucess
:endsucess
echo ====================Status=====================
echo Done!
goto :endofscript
:endfail
echo ====================Status=====================
echo Status: Error!
:endofscript
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment