If you are flashing in fastboot mode, all the files that you want to be transfered to device should be placed in a folder with fastboot.exe file. Also there is adb.exe file, but in this case we’ve got nothing to do with it. Recovery rom or boot.img file can be named as you wish, as long as in the command line you write the exact name of the rom file you want to flash. If the rom is named “boot.img” the command should be written with the same file name.
Flashing your MIUI Smartphone with Fastboot Rom
Boot your device in fastboot mode using combination of keys Volume- and power button at the same time. You will see a rabbit in a fur hat image, the phone is in fastboot mode now 😉
Next step is to enter the folder on the computer where our rom files are located. For example I’ve got a folder called “Tools”, where I’ve got all required tools for working with adb and fastboot. All my rom .img files are going straight there.
Now launch the command prompt on your computer.
Enter the command cd C:\tools (or how your folder is named), with this command we change directory to C:\tools. Next enter “fastboot devices” command (your smartphone should be already in fastboot mode and connected through USB). Now you should see the device ID number (a combination of numbers and letters that is unique for your phone). If this didn’t happen, you see nothind and device list is empty it means that your device is not connected. This is either a problem with drivers or with USB connection.
Well, let’s assume that the phone was determined and connected. Next, enter this command:
fastboot flash boot boot.img
Where the word “flash” – it means “flashing your device”, the word “boot” means the partition, and the third word indicates the file name that used for flash. Enter this command without any mistakes and press Enter.
The process of flashing is fast and the result is immediately visible in the command-line interface. So we flashed the boot.img rom. If you want to flash recovery rom, the process will be pretty similar. The command for flashing recovery looks like this:
fastboot flash recovery recovery.img
Where the “recovery” means the recovery partition, which is flashing. “recovery.img” – name of recovery rom file. You can name it even xiaomifirmware.img, but then the command should be written like this:
fastboot flash recovery xiaomifirmware.img
I hope everything is clear.
After firmware flashing is completed, you can enter this command:
The device will reboot the system.
fastboot boot twrp123.img
Where twrp123.img – TWRP rom name (it can be different)
Press “Enter” and the smartphone should boot into TWRP virtual recovery. While working in recovery mode you can install everything you need (ROOT, patches, etc).
Other Fastboot commands:
- fastboot devices – a list of devices connected to the computer (used to check the USB connection).
- fastboot reboot – reboots smartphone.
- fastboot reboot-bootloader – reboot the device in bootloader mode.
- fastboot flash boot filename.img – core flashing with boot.img
- flashboot flash radio filename.img – radio module flashing
- fastboot oem lock – close the bootloader.
- fastboot oem unlock – open bootloader (deletes all user data)