The Fastboot, same as him ADB is a tool that allows us to communicate with an Android device directly from the PC. It consists of a series of commands with which we can send orders to the phone or tablet, and they can serve us both to root a terminal and to flash a new firmware or try to repair it from a brick.
Unlike ADB, which we can use without having access to the recovery or the operating system, in the case of fastboot, we can make use of it directly from the bootloader mode or when ADB commands don't even work. A true lifesaver and a supreme tool, folks!
First of all, make sure you have installed the device drivers on your PC
If we want to operate using fastboot, it is important that we install all the Android terminal drivers on the PC, as well as the corresponding fastboot package. You can get more information about it in this other post.
List of commands and structure for fastboot
The number of fastboot commands is quite large, and although we will often only use a couple of them, it is interesting to know the ecosystem of functions that the tool offers.
How to use fastboot
The fastboot commands follow the following structure:
Fastboot command list
|update||flash device from update.zip|
|flashall||flash boot + recovery + system|
|flash ||write a file to a flash partition|
|erase||delete a flash partition|
|format||format a flash partition|
|getvar||show a variable from the bootloader|
|boot ||download and boot the kernel|
|flash: raw boot ||create a boot image and flash it|
|devices||list of connected devices|
|continue||continue with autostart|
|reboot||restart the device normally|
|reboot-bootloader||reboot device in bootloader|
|help||show help message|
|-w||delete user data, cache and format|
|if the partition type supports it.|
|-or||don't delete partition before formatting|
|-s||specify device serial number|
|or path to device port|
|-l||with «devices» it shows the path of the devices.|
|-p||specify product number|
|-c||override kernel command line|
|-i||specify the vendor id of a custom USB|
|-b||specifies the base address of a custom kernel|
|-n||specify nand page size. Default: 2048|
|-S [K | M | G]||automatically discard files larger than|
|indicated size. 0 to disable.|
In addition to these we also have other commands, such as:
fastboot oem unlock (to unlock the bootloader)
fastboot oem lock (to lock the bootloader)
User guide: a couple of practical examples to familiarize ourselves with fastboot
Before starting to launch commands, the first thing to do is make sure that the fastboot has detected the Android phone that we just connected to the PC. To do this, we launch the following command:
If everything has gone correctly, we will see the identification number of our connected device on the screen. If it does not show anything, it means that something has not gone well (check drivers etc.).
If we are going to flash files and images, it is important that all files are located in the same path from where we execute the commands in ms-dos.All the images and firmware files are in the "adb" folder.
From here we can do whatever we want. For example, we can install a custom recovery with the following commands:
fastboot erase recovery – – we erase the current recovery
fastboot flash recovery recovery.img – – where "recovery.img" corresponds to the new recovery that we want to flash
Now that we have a custom recovery, we can install a custom ROM or an official firmware. We could do it from the new recovery that we just installed (TWRP or any other) or from the same fastboot.
fastboot erase system –w - - we delete the system partition
fastboot erase boot - - we delete the boot
fastboot update romcustomizado.zip – – we flash the new ROM, where "romcustomizado.zip" corresponds to the ROM we want to install
fastboot reboot - - we restart the device
If instead of installing a ROM we want to do a complete erase previous (so we make sure that the terminal is clean as the whistle), we can also do it from the fastboot:
fastboot erase system
fastboot erase data
fastboot erase cache
We can also flash only some parts or images of the firmware of our Android. We can go one by one or install only the one that interests us:
fastboot flash userdata data.img
fastboot flash system system.img
fastboot flash boot boot.img
Next, I also leave you a practical example. The other day I was flashing a Yotaphone, and finally I ended up manually installing all the files that make up the firmware.
All the files were stored in the "firmware" folder inside the folder where I have all the adb drivers. The commands to execute were the following (you can mold this example to the files that make up the firmware of your Android):
fastboot flash aboot firmware / emmc_appsboot.mbn
fastboot flash boot firmware / boot.img
fastboot flash cache firmware / cache.img
fastboot flash modem firmware / radio / NON-HLOS.bin
fastboot flash sbl1 firmware / radio / sbl1.mbn
fastboot flash rpm firmware / radio / rpm.mbn
fastboot flash tz firmware / radio / tz.mbn
fastboot flash userdata firmware / userdata.img
fastboot flash -S 512M system firmware / system.img
I hope that this little tutorial has helped you to learn more about this interesting platform that is Android, and as always, you hesitate to leave your impressions and ideas in the comments area.You have Telegram installed? Receive the best post of each day on our channel. Or if you prefer, find out everything from our Facebook page.