AdbOnWin — Android Platform Tools para Windows
  • PowerShell 100%
Find a file
2026-05-02 11:52:22 -05:00
assets alterada a permissão do arquivo de licencimento no sistema de arquivos 2026-05-02 11:51:43 -05:00
log Commit inicial. Código gerado pelo Claude Sonnet 4.6 (Anthropic) 2026-04-28 15:49:14 -05:00
src Commit inicial. Código gerado pelo Claude Sonnet 4.6 (Anthropic) 2026-04-28 15:49:14 -05:00
.env.example Commit inicial. Código gerado pelo Claude Sonnet 4.6 (Anthropic) 2026-04-28 15:49:14 -05:00
.gitattributes inclusão da normalização de line-endings 2026-04-28 16:07:09 -05:00
.gitignore Commit inicial. Código gerado pelo Claude Sonnet 4.6 (Anthropic) 2026-04-28 15:49:14 -05:00
LICENSE alterada a permissão do arquivo de licencimento no sistema de arquivos 2026-05-02 11:51:43 -05:00
README.en-US.md inclusão do README em inglês 2026-05-02 11:52:22 -05:00
README.md alterada a permissão do arquivo de licencimento no sistema de arquivos 2026-05-02 11:51:43 -05:00

PowerShell Logo

AdbOnWin

Automated Android Platform Tools installation and setup for Windows

License: MIT PowerShell Platform Admin pt-BR


Table of Contents


Overview

AdbOnWin is a PowerShell script that automatically installs and configures the Android development environment on Windows, including:

  • Android Platform Tools (adb, fastboot)
  • Google USB Driver
  • UAD-NG (Universal Android Debloater Next Generation)

The script detects local files under .\tools\ and uses them when available, downloading only what is missing.


About UAD-NG

This project was created to set up the environment required to use Universal Android Debloater Next Generation (UAD-NG).

UAD-NG is a tool developed by the Universal Debloater Alliance that lets you safely remove bloatware from Android devices through an accessible visual interface — something manufacturers should provide out of the box, but don't.

AdbOnWin simply sets up a working ADB environment on Windows so you can get there without friction. All credit for the part that truly matters goes to the UAD-NG developers.


Prerequisites

  • Windows 7+ (64-bit)
  • PowerShell 3.0 or later
  • Administrator privileges (required — the script modifies the system PATH and installs drivers)

1. Clone the repository

git clone https://forge.itamarcampos.com.br/itamcampos/adbonwin.git
cd adbonwin

2. (Optional) Add local files

Place installation files in the folders below to skip downloads:

tools/
├── platform-tools/     → platform-tools .zip file
├── usb-driver/         → Google USB Driver .zip file
└── uad-ng/win/
    └── v1.2.0/         → uad-ng-windows.exe

If the folders are empty or missing, the script downloads everything automatically.

3. Run as Administrator

.\AdbOnWin.ps1

Make sure PowerShell is opened as Administrator before running.


Remote Execution

To run without cloning the repository, choose one of the options below.


Option 1 — irm | iex (already elevated session)

Use this if PowerShell is already running as Administrator:

irm https://forge.itamarcampos.com.br/itamcampos/adbonwin/raw/branch/main/src/AdbOnWin.ps1 | iex

This option downloads the script and relaunches it with Administrator privileges automatically via UAC, regardless of how the terminal was opened:

$url  = 'https://forge.itamarcampos.com.br/itamcampos/adbonwin/raw/branch/main/src/AdbOnWin.ps1'
$dest = Join-Path $env:TEMP 'AdbOnWin.ps1'

Invoke-WebRequest -Uri $url -OutFile $dest -UseBasicParsing

Start-Process powershell.exe `
    -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$dest`"" `
    -Verb RunAs `
    -Wait

The -Verb RunAs parameter triggers the UAC prompt. The script only proceeds after confirmation.


Security notice: Always review script contents before running them with elevated privileges. Inspect the source at https://forge.itamarcampos.com.br/itamcampos/adbonwin.


Parameters

Parameter Description
-Verbose Displays detailed debug messages
-SkipPause Skips the keypress prompt at the end (useful for automation and CI/CD)
# Verbose mode
.\AdbOnWin.ps1 -Verbose

# No pause at the end (automated scripts)
.\AdbOnWin.ps1 -SkipPause

What the Script Does

  1. Checks for local files under .\tools\
  2. Downloads from the internet anything not found locally
  3. Installs Platform Tools to C:\Program Files\Android\platform-tools
  4. Installs the USB Driver to C:\Program Files\Android\usb_driver
  5. Installs UAD-NG alongside Platform Tools
  6. Automatically adds the directory to the system PATH
  7. Saves download backups to %USERPROFILE%\Downloads\AndroidPlatformTools

After Installation

1. Restart the terminal to apply the PATH changes.

2. Verify the ADB installation:

adb version

3. To launch UAD-NG:

uad-ng-windows.exe

Xiaomi Devices

  • Enable USB Debugging in Developer Options
  • Use File Transfer (MTP) mode when connecting
  • Make sure the USB cable supports data transfer (not charge-only)

Common Issues

"Running scripts is disabled on this system"

The PowerShell execution policy is blocking the script. Run this once:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

ADB not recognized after installation

The PATH was updated, but the current session still holds the old value. Restart the terminal or open a new PowerShell window.

Failed to remove previous installation

ADB is in use by another process. Close Android Studio, Scrcpy, or any other program using ADB and try again.


Contributing

Suggestions and improvements are welcome. Open an issue or submit a pull request.


Made by itamcampos