Have you ever used the Fastboot commands? If not, you might at least be familiar with the Fastboot mode on Android devices. ADB and Fastboot can perform different command-line operations using a computer. Below is the complete list of Fastboot commands with their descriptions to help you understand them better. You can use ADB Shell commands when your Android device is turned on. However, to execute Fastboot commands, you must boot your device into Fastboot mode.
What is Fastboot?
Like ADB (Android Debug Bridge), Fastboot is a command-line protocol on Android devices. It works as a communication bridge between your computer and Android device. Fastboot commands work only when your device is booted into the Fastboot or bootloader mode. Using these commands, you can reboot the bootloader, enable or disable OEM unlock, and flash factory images or modify partitions on your device.
ADB commands require an Android device connected via USB or ADB over Wi-Fi. However, Fastboot commands require a connected Android device (via USB) booted in the Fastboot or Bootloader Mode. While you need to enable USB debugging to use ADB commands, Fastboot does not require it at all.
You can boot an Android device into the Fastboot mode by pressing the Volume Down + Power buttons simultaneously for 3-5 seconds. On some devices, you might need to use the Volume Up key instead. Alternatively, you can enter the Fastboot or Bootloader mode using ADB. Connect your phone to a Windows, Mac, or Linux computer and execute the following commands one after another. Make sure your phone’s screen is unlocked.
adb devices
Authorize ADB on your device when prompted and ADB will return your device ID to indicate it has recognized your device.
Having ensured a proper connection, execute the following command:
adb reboot bootloader
Your Android device will reboot into Fastboot Mode.
Complete List of Fastboot Commands
Warning: Fastboot commands can brick or damage your device if used irresponsibly. Also, Fastboot commands do not work on Samsung devices.
Get Information about Fastboot
-
fastboot help
-
fastboot oem help
-
fastboot oem hw help
You can use these 3 Fastboot commands to get information about commands, parameters, and conditions along with their descriptions.
Check Fastboot Connection Status
fastboot devices fastboot devices [-l] (with the path of the device/s)
This command shows the list of devices connected to your computer.
Get Device Information
fastboot oem
There are some interesting variations of the ‘fastboot oem’ command that work with different parameters as described below:
fastboot oem device-info
The above command, for instance, will display a detailed list of information about your Android device. Similarly, you can add the following parameters after fastboot oem
to perform certain tasks and get more info.
-
setbrightness
-
get_config
-
set_config
-
rm_config
-
esim_erase
-
esim_atp
-
uart
-
HALT
-
sha1sum
-
ddrtest
-
ramdump
-
dmesg
-
rma
-
ramdump_sahara
-
dump-chipid
-
check-hw-security
-
get_platform_info
-
set_platform_info
-
select-display-panel
-
off-mode-charge
-
set_display_power_mode
-
enable-factory-lock
-
factory-lock
-
continue-factory
Display Miscellaneous Info about Android Device
-
fastboot getvar [NAME]
-
fastboot getvar battery-status
-
fastboot getvar battery-voltage
-
fastboot getvar boot-mode
-
fastboot getvar build-mode
-
fastboot getvar cidnum
-
fastboot getvar gencheckpt
-
fastboot getvar imei
-
fastboot getvar meid
-
fastboot getvar modelid
-
fastboot getvar partition-layout
-
fastboot getvar platform
-
fastboot getvar product
-
fastboot getvar security
-
fastboot getvar serialno
-
fastboot getvar version
-
fastboot getvar version-baseband
-
fastboot getvar version-bootloader
-
fastboot getvar version-cpld
-
fastboot getvar version-main
-
fastboot getvar version-microp
-
fastboot getvar version-misc
GetVar means “get variables”. To get even more information about your Android phone or tablet, use the Fastboot commands listed above.
Fastboot Command to Unlock the Bootloader
-
fastboot oem unlock
-
fastboot flashing unlock
This command can unlock the bootloader on Android devices from OEMs like Google Pixel, OnePlus, Motorola, Nokia, etc. You may also need an unlock key from your device manufacturer to unlock the bootloader.
Read Also: How to Unlock Android PIN and Pattern via ADB
Relock the Bootloader
-
fastboot oem lock
-
fastboot flashing lock
Once unlocked the bootloader, you can relock it later by using the above command.
Reboot Android Device
fastboot reboot
This command reboots your device into the ROM.
Reboot Android Devices into FastbootD Mode
fastboot reboot fastboot
When your Android device is still booted into Fastboot, you can use this command to reboot into FastbootD mode.
Reboot the Device into the Recovery Mode
fastboot reboot recovery
Reboots Android devices into Recovery mode.
Reboot the Device into the Bootloader Mode
fastboot reboot bootloader
Sometimes, you may need to reboot the Fastboot or Bootloader mode while flashing images. This command will do that for you.
Fastboot Commands to Flash System Image File and TWRP
fastboot flash
This command is used to flash factory images, recovery, boot, radio, system, and other images to your Android device. Check out these examples:
-
fastboot flash boot boot.img
-
fastboot flash system system.img
-
fastboot flash recovery recovery.img
-
fastboot flash cache cache.img
-
fastboot flash modem NON-HLOS.bin
-
fastboot flash sbl1 sbl1.mbn
-
fastboot flash dbi sdi.mbn
-
fastboot flash aboot emmc_appsboot.mbn
-
fastboot flash rpm rpm.mbn
-
fastboot flash tz tz.mbn
-
fastboot flash LOGO logo.bin
Similarly, you can use the following command to flash TWRP recovery.
fastboot flash recovery twrp.img
fastboot flash recovery TWRP-recovery.zip
Boot into TWRP via Fastboot
fastboot boot recovery twrp.img
Boot your Android device into a custom recovery mode temporarily without flashing it.
Format the Userdata Partition
fastboot erase userdata
You can use this command to erase your phone’s data.
Flash All Partitions at Once
fastboot -w flashall
If you want to flash all partitions on your Android device at once, you can use the above Fastboot command.
Restore from Backed-up Images
If you have backed up the system, data, and cache image files from your phone and want to restore them, you can do that by erasing the current partitions and flashing the backed-up images saved on your computer. Make sure to issue the commands given below in the same sequence.
-
fastboot erase system
-
fastboot erase data
-
fastboot erase cache
Once you have erased the above partitions, use these commands to restore your backup:
-
fastboot flash system system.img
-
fastboot flash data data.img
-
fastboot flash cache cache.img
You can download the Fastboot commands list as a PDFÂ as well. If you have any questions about ADB and Fastboot commands, leave a comment below.