The Android Debug Bridge (ADB) and Fastboot command-line tools—collectively distributed by Google as the Android SDK Platform-Tools—are the universal Swiss Army knife of Android maintenance, diagnostics, and software recovery. Whether you are extracting system logs from a crashing device, reflashing a corrupted kernel, or configuring advanced recovery environments, command-line mastery of ADB and Fastboot is essential.
This tutorial provides a complete walkthrough on properly configuring Platform-Tools on Windows 10 and 11, configuring global system environment variables, and utilizing the most effective diagnostic terminal commands for day-to-day repair operations.
Step 1: Installing & Configuring Platform-Tools on Windows
- Download the latest official Android SDK Platform-Tools for Windows directly from Google’s developer repository.
- Extract the downloaded
platform-tools_rXX-windows.zipto a permanent root directory on your primary drive, such asC:\platform-tools\. - Add to System Environment Variables (PATH):
- Press
Win + S, search for "Edit the system environment variables", and hit Enter. - Click the Environment Variables... button in the bottom-right corner.
- Under System variables, locate the Path variable and click Edit....
- Click New, enter
C:\platform-tools, and click OK on all windows.
- Press
- Open a fresh Command Prompt or PowerShell window and type
adb --version. If configured correctly, the installed version and build details will be displayed from any working folder.
Core ADB Commands for Diagnostics & Recovery
ADB operates while the smartphone is booted into the Android OS (with USB Debugging enabled in Developer Options) or while running a custom recovery environment (such as TWRP):
1. Connection & Device Verification
# Lists all connected ADB devices and their authorization status
adb devices
# Restarts the background ADB host server
adb kill-server
adb start-server
2. Recovery & Bootloader Transitions
# Reboots the phone directly into Recovery Mode
adb reboot recovery
# Reboots the phone into Fastboot (Bootloader) Mode
adb reboot bootloader
# Reboots modern Qualcomm devices into Emergency Download Mode
adb reboot edl
3. File Transfer & Sideloading
# Copies files from your PC to the smartphone storage
adb push C:\firmware\boot.img /sdcard/boot.img
# Copies files from the smartphone to your computer
adb pull /sdcard/DCIM/ ./backup_photos/
# Sideloads official OTA recovery updates in Stock Recovery
adb sideload update.zip
4. Crash Analysis & Diagnostic Logs
# Dumps the live system crash log to a text file for bootloop analysis
adb logcat -d > crash_log.txt
# Inspects battery charging voltage, health, and thermals
adb shell dumpsys battery
Core Fastboot Commands for Partition Repair
Fastboot operates when the smartphone is in Fastboot Mode (Bootloader), enabling low-level partition writing across unlocked devices:
1. Hardware Status & Partition Querying
# Verifies Fastboot USB connection
fastboot devices
# Dumps detailed hardware variables (unlocked state, battery voltage, active slot)
fastboot getvar all
# Checks which slot is active on A/B partitioned devices
fastboot getvar current-slot
2. Flashing Core Partitions
# Flashes clean kernel and ramdisk
fastboot flash boot boot.img
# Flashes recovery partition (on non-A/B or dedicated recovery devices)
fastboot flash recovery recovery.img
# Flashes device tree blob overlay
fastboot flash dtbo dtbo.img
# Flashes initialization boot on modern Android 13/14 devices
fastboot flash init_boot init_boot.img
# Flashes Android Verified Boot metadata with verity disabled
fastboot flash vbmeta vbmeta.img --disable-verity --disable-verification
3. Managing A/B Seamless Partition Slots
# Switches active boot slot from A to B (or vice versa) to recover unbootable updates
fastboot set_active a
fastboot set_active b
# Reboots the device back into Android
fastboot reboot
Fastbootd Mode (Dynamic Super Partitions)
Introduced in Android 10, modern smartphones house dynamic partitions (system, vendor, product, odm) inside a giant container called super. To flash individual dynamic sub-partitions, you must transition from standard Fastboot into userspace Fastbootd:
# Reboots from Bootloader into userspace Fastbootd
fastboot reboot fastboot
# Now dynamic partitions can be flashed directly:
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash product product.img
Quick Reference Cheat Sheet
| Operation | Terminal Command | Target State |
|---|---|---|
| Check ADB Link | adb devices |
Android / Recovery |
| Reboot to Fastboot | adb reboot bootloader |
Android / Recovery |
| Check Fastboot Link | fastboot devices |
Fastboot Mode |
| Switch Active Slot | fastboot set_active [a/b] |
Fastboot Mode |
| Enter Fastbootd | fastboot reboot fastboot |
Fastboot Mode |
| Flash Kernel | fastboot flash boot boot.img |
Fastboot Mode |