ACC Logo
Tool Documentation

Fastboot Commands Reference

Fastboot is a diagnostic and engineering protocol that lets you communicate directly with the device bootloader over USB. It is used to flash custom recoveries, kernels, partitions, and unlock bootloader security.

Getting Started with Fastboot
CAUTION: LOW-LEVEL HARDWARE INTERFACE Fastboot operates before the Android OS kernel starts. Flashing incompatible images or unlocking the bootloader will erase user data and can soft-brick or hard-brick your hardware. Double-check command parameters before execution.
TOTAL COMMANDS 28 indexed
CATEGORIES 10 sections
ENVIRONMENT Bootloader / FastbootD
COMMUNICATION Direct USB Protocol
Official Companion Repositories by Maintainer:

Need device-specific OEM unlock guides or Project Treble GSI flashing tutorials?

Risk:
Showing 28 commands
Device DetectionSafe
$fastboot devices
What it does:

Scans USB buses and lists all Android hardware currently running in low-level bootloader / fastboot protocol mode.

Device InformationSafe
$fastboot getvar all
What it does:

Dumps the entire set of hardware and bootloader environment variables exposed by the device firmware.

Device InformationSafe
$fastboot getvar unlocked
What it does:

Queries whether the bootloader is currently locked ("no") or unlocked ("yes"). Unlocking is mandatory before flashing partitions.

Device InformationSafe
$fastboot getvar current-slot
What it does:

Returns which partition slot (either "a" or "b") the device is currently configured to boot from on A/B dual-slot devices.

Device InformationSafe
$fastboot oem device-info
What it does:

Displays OEM manufacturer-specific security data, including tamper status, critical unlock flag, and charger screen status.

RebootSafe
$fastboot reboot
What it does:

Restarts the device normal operating system, exiting the bootloader environment.

RebootSafe
$fastboot reboot-bootloader
What it does:

Reboots the hardware and immediately re-enters the bootloader/fastboot interface. Useful for reloading partition tables after flashing.

RebootSafe
$fastboot reboot fastboot
What it does:

Switches the device into FastbootD mode, which runs within recovery ramdisk to facilitate resizing and flashing logical dynamic partitions.

RebootSafe
$fastboot reboot recovery
What it does:

Reboots the device from Fastboot mode straight into recovery mode (TWRP, OrangeFox, or stock recovery).

RebootSafe
$fastboot continue
What it does:

Instructs the bootloader to continue loading the OS kernel without performing a full hardware power cycle.

Unlock/LockDestructive
$fastboot flashing unlock
What it does:

Initiates standard bootloader unlocking on modern Android devices (Android 6.0+). Prompts on-screen confirmation and factory resets all user data.

Unlock/LockDestructive
$fastboot flashing lock
What it does:

Re-locks the bootloader and re-enables Android Verified Boot (AVB). Requires 100% stock firmware; factory resets the device.

Unlock/LockDestructive
$fastboot flashing unlock_critical
What it does:

Unlocks deeper, critical bootloader and low-level firmware partitions (e.g. bootloader, radio, abl) on devices requiring extra authorization.

Unlock/LockDestructive
$fastboot oem unlock
What it does:

Legacy command used to unlock bootloaders on older Android devices (Android 5.1 and earlier, or specific OEM implementations).

Boot ImagesSafe
$fastboot boot <boot_image.img>
What it does:

Loads and boots a kernel or recovery image (like TWRP or patched boot.img) directly into RAM without flashing or overwriting the device flash storage.

FlashingCaution
$fastboot flash boot <boot.img>
What it does:

Writes a kernel boot image to the boot partition. Commonly used for rooting with Magisk or installing custom kernels.

FlashingCaution
$fastboot flash init_boot <init_boot.img>
What it does:

Flashes the dedicated init_boot partition introduced in Android 13+ devices (e.g. Pixel 7/8/9, Galaxy S23/S24) for Magisk / KernelSU root.

FlashingCaution
$fastboot flash recovery <recovery.img>
What it does:

Installs a custom recovery (such as TWRP or OrangeFox) onto the dedicated recovery partition (on legacy or non-A/B devices).

FlashingDestructive
$fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
What it does:

Flashes the Verified Boot Metadata partition while explicitly patching security flags to allow booting custom or modified system partitions.

FlashingDestructive
$fastboot flash system <system.img>
What it does:

Writes a complete Android operating system system image or Generic System Image (GSI) to the system partition.

FlashingDestructive
$fastboot flashall -w
What it does:

Flashes all firmware images (bootloader, radio, boot, system, vendor, product) contained in the current directory matching Android factory specs.

ErasingDestructive
$fastboot erase userdata
What it does:

Performs a hardware-level raw sector wipe of the userdata partition, removing all user accounts, installed apps, photos, and settings.

ErasingDestructive
$fastboot -w
What it does:

Standard Fastboot shortcut to erase both the userdata partition and cache partition simultaneously before installing a clean ROM.

ErasingDestructive
$fastboot erase system
What it does:

Wipes the system partition clean prior to flashing a fresh operating system image.

PartitionsCaution
$fastboot set_active <a|b|other>
What it does:

Changes the active bootable slot on dual-slot A/B partition architectures. Critical for recovering from a bad update on the other slot.

PartitionsDestructive
$fastboot format:ext4 userdata
What it does:

Formats and creates a fresh filesystem (ext4 or f2fs) on the userdata partition. Essential when removing encryption or switching filesystem types.

AdvancedCaution
$fastboot flash --slot=all boot boot.img
What it does:

Flashes the specified image to both slot _a and slot _b in one command, ensuring slot parity.

AdvancedSafe
$fastboot stage <file>
What it does:

Uploads raw binary data to the bootloader buffer without writing it directly to a flash storage partition.