Created
April 22, 2026 19:57
-
-
Save Davi-zzz/51802c1e9fcdde3236acf907175cf52f to your computer and use it in GitHub Desktop.
script to quickly install adb on windows machines
This file contains hidden or 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 | |
| setlocal | |
| echo ======================================== | |
| echo INSTALANDO ADB | |
| echo ======================================== | |
| set "ADB_DIR=C:\adb" | |
| set "ZIP_FILE=%TEMP%\platform-tools.zip" | |
| echo. | |
| echo [1/5] Baixando... | |
| powershell -Command "Invoke-WebRequest https://dl.google.com/android/repository/platform-tools-latest-windows.zip -OutFile '%ZIP_FILE%'" | |
| if not exist "%ZIP_FILE%" ( | |
| echo ERRO no download | |
| pause | |
| exit /b | |
| ) | |
| echo OK | |
| echo. | |
| echo [2/5] Extraindo... | |
| tar -xf "%ZIP_FILE%" -C "%TEMP%" | |
| if not exist "%TEMP%\platform-tools\adb.exe" ( | |
| echo ERRO na extracao | |
| pause | |
| exit /b | |
| ) | |
| echo OK | |
| echo. | |
| echo [3/5] Movendo... | |
| if exist "%ADB_DIR%" rmdir /s /q "%ADB_DIR%" | |
| move "%TEMP%\platform-tools" "%ADB_DIR%" | |
| echo OK | |
| echo. | |
| echo [4/5] Adicionando ao PATH... | |
| setx PATH "%PATH%;%ADB_DIR%" | |
| echo OK | |
| echo. | |
| echo [5/5] Testando... | |
| "%ADB_DIR%\adb" version | |
| echo. | |
| echo FINALIZADO | |
| echo Feche o terminal e abra novamente | |
| pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment