LinuxCommandLibrary

fastboot

Flash images to Android devices

TLDR

Unlock the bootloader

$ fastboot oem unlock
copy

Relock the bootloader
$ fastboot oem lock
copy

Reboot the device from fastboot mode into fastboot mode again
$ fastboot reboot bootloader
copy

Flash a given image
$ fastboot flash [path/to/file.img]
copy

Flash a custom recovery image
$ fastboot flash recovery [path/to/file.img]
copy

List connected devices
$ fastboot devices
copy

Display all information of a device
$ fastboot getvar all
copy

SYNOPSIS

fastboot [ options ] command

PARAMETERS

-w
    Wipe user data and cache.

-u
    Specify a unique identifier (serial number) for the device. Needed when multiple devices are connected.

flash partition image
    Flash a specific image file to a partition.

erase partition
    Erase a specific partition.

reboot
    Reboot the device.

reboot-bootloader
    Reboot the device into the bootloader.

devices
    List all connected fastboot devices.

oem command
    Execute a vendor-specific OEM command.

unlock
    Unlock the device bootloader.

flashing unlock
    Unlock the device bootloader.

flashing lock
    Lock the device bootloader.

update image.zip
    Update the device with a zip image file.

DESCRIPTION

fastboot is a command-line tool used primarily for flashing partitions on Android devices (phones, tablets, etc.) while they are in bootloader mode. It allows users to modify the device's system image, kernel, recovery image, and other partitions directly. This is particularly useful for installing custom ROMs, applying updates manually, unlocking the bootloader, and recovering devices from corrupted software. Fastboot facilitates direct communication between a host computer and the device's bootloader, bypassing the operating system.

It's an essential tool for Android developers and advanced users who need to customize or repair their devices beyond what the stock Android operating system allows. Care should be taken when using fastboot commands, as incorrect usage can lead to bricking or data loss. Unlocking the bootloader, a common prerequisite for using fastboot extensively, often voids the device warranty.

CAVEATS

Incorrect use of fastboot can lead to irreversible device damage (bricking). Unlocking the bootloader typically voids the device warranty and wipes all data. Ensure you have the correct drivers installed for your device. Back up all important data before using fastboot commands.

DEVICE STATE

The device needs to be in 'fastboot mode' (also known as 'bootloader mode') to be recognized by the fastboot tool. The method to enter fastboot mode varies depending on the device manufacturer and model. Common methods involve holding specific button combinations (e.g., Volume Down + Power) while booting the device. Check your device manufacturer documentation for the correct procedure.

HISTORY

Fastboot was developed as part of the Android Open Source Project (AOSP). It emerged as a tool to provide a more low-level interface for interacting with Android devices, specifically for developers and advanced users who needed to customize or repair their devices. It's usage expanded with the growth of the Android modding community, facilitating the flashing of custom ROMs and recoveries. Over time, new features and commands have been added to support evolving Android device architectures and functionalities.

SEE ALSO

adb(1)

Copied to clipboard