Fastboot is a protocol and it has a tool with the same name included with the Android SDK package used primarily to modify the flash filesystem via a USB connection from host computer. It requires that the device be started in a boot loader or Secondary Program Loader mode, in which only the most basic hardware initialization is performed. After enabling the protocol on the device itself, it will accept a specific set of commands sent to it via USB using a command line. Some of the most commonly used fastboot commands include:
- flash – rewrites a partition with a binary image stored on the host computer.
- erase – erases a specific partition.
- reboot – reboots the device into either the main operating system, the system recovery partition or back into its boot loader.
- devices – displays a list of all devices (with the serial number) connected to the host computer.
- format – formats a specific partition; the file system of the partition must be recognized by the device.
this command will show you the following list
update <filename> Reflash device from update.zip.
Sets the flashed slot as active.
flashall Flash boot, system, vendor, and --
if found -- recovery. If the device
supports slots, the slot that has
been flashed to is set as active.
Secondary images may be flashed to
an inactive slot.
flash <partition> [ <filename> ] Write a file to a flash partition.
flashing lock Locks the device. Prevents flashing.
flashing unlock Unlocks the device. Allows flashing
any partition except
flashing lock_critical Prevents flashing bootloader-related
flashing unlock_critical Enables flashing bootloader-related
flashing get_unlock_ability Queries bootloader to see if the
device is unlocked.
flashing get_unlock_bootloader_nonce Queries the bootloader to get the
flashing unlock_bootloader <request> Issue unlock bootloader using request.
flashing lock_bootloader Locks the bootloader to prevent
bootloader version rollback.
erase <partition> Erase a flash partition.
format[:[<fs type>][:[<size>]] <partition>
Format a flash partition. Can
override the fs type and/or size
the bootloader reports.
getvar <variable> Display a bootloader variable.
set_active <slot> Sets the active slot. If slots are
not supported, this does nothing.
boot <kernel> [ <ramdisk> [ <second> ] ] Download and boot kernel.
flash:raw <bootable-partition> <kernel> [ <ramdisk> [ <second> ] ]
Create bootimage and flash it.
devices [-l] List all connected devices [with
continue Continue with autoboot.
reboot [bootloader|emergency] Reboot device [into bootloader or emergency mode].
reboot-bootloader Reboot device into bootloader.
oem <parameter1> ... <parameterN> Executes oem specific command.
stage <infile> Sends contents of <infile> to stage for
the next command. Supported only on
Android Things devices.
get_staged <outfile> Receives data to <outfile> staged by the
last command. Supported only on Android
help Show this help message.
-w Erase userdata and cache (and format
if supported by partition type).
-u Do not erase partition before
-s <specific device> Specify a device. For USB, provide either
a serial number or path to device port.
For ethernet, provide an address in the
form <protocol>:<hostname>[:port] where
<protocol> is either tcp or udp.
-c <cmdline> Override kernel commandline.
-i <vendor id> Specify a custom USB vendor id.
-b, --base <base_addr> Specify a custom kernel base
address (default: 0x10000000).
--kernel-offset Specify a custom kernel offset.
--ramdisk-offset Specify a custom ramdisk offset.
--tags-offset Specify a custom tags offset.
-n, --page-size <page size> Specify the nand page size
-S <size>[K|M|G] Automatically sparse files greater
than 'size'. 0 to disable.
--slot <slot> Specify slot name to be used if the
device supports slots. All operations
on partitions that support slots will
be done on the slot specified.
'all' can be given to refer to all slots.
'other' can be given to refer to a
non-current slot. If this flag is not
used, slotted partitions will default
to the current active slot.
-a, --set-active[=<slot>] Sets the active slot. If no slot is
provided, this will default to the value
given by --slot. If slots are not
supported, this does nothing. This will
run after all non-reboot commands.
--skip-secondary Will not flash secondary slots when
performing a flashall or update. This
will preserve data on other slots.
--skip-reboot Will not reboot the device when
performing commands that normally
trigger a reboot.
--disable-verity Set the disable-verity flag in the
the vbmeta image being flashed.
--disable-verification Set the disable-verification flag in the vbmeta image being flashed.
--wipe-and-use-fbe On devices which support it,
erase userdata and cache, and
enable file-based encryption
--unbuffered Do not buffer input or output.
--version Display version.
-h, --help show this message.