Can't flash TWRP image on Moto E5+
I try to install a custom ROM on my Motorola Moto E5+. To do that, I'm following this tutorial (and check what is said online on the tools used): https://www.getdroidtips.com/lineage-os-17-motorola-moto-e5-plus/ . So I'm at the step where I need to flash the TWRP image, but it seems to don't work.
$ ./adb devices * daemon not running; starting now at tcp:5037 * daemon started successfully List of devices attached ZL5225HPHW device $ ./adb reboot bootloader $ sudo ./fastboot flash recovery ../twrp-3.6.0_9-0-hannah.img (bootloader) is-logical:recovery: not found Sending 'recovery' (20972 KB) OKAY [ 0.851s] Writin 'recovery' (bootloader) Image recovery failed validation (bootloader) Preflash validation failed FAILED (remote: '') fastboot: error: Command failed $ sudo ./fastboot boot ../twrp-3.6.0_9-0-hannah.img Sending 'boot.img' (20972 KB) OKAY [ 0.685s] Booting (bootloader) permission denied! FAILED (remote: '') fastboot: error: Command failed
So I try to use the command:
./fastboot flash recovery ../../Downloads/twrp-3.6.0_9-0-hannah.img(I'm sudo because it doesn't recognize my phone without) and I try to boot with the image as proposed here: https://android.stackexchange.com/questions/211996/cant-flash-custom-twrp-recovery-image-on-motorola-moto-g7-power-phone But it doesn't work either. On my phone, it says "Mismatched partition size (recovery)" when I try to flash. And when I try to boot, it just say
bootand that it.
Btw, I download the file from here: https://twrp.me/motorola/motorolamotoe5plus.html .
So do you know what I'm missing and what I need to do? Or even if I'm doing it right?
PS: when I'm trying with the official guide of LineageOS, it's doing the same:
$ sudo ./fastboot flash recovery ../lineage-18.1-20220104-recovery-hannah.img (bootloader) is-logical:recovery: not found Sending 'recovery' (15432 KB) OKAY [ 0.666s] Writing 'recovery' (bootloader) Image recovery failed validation (bootloader) Preflash validation failed FAILED (remote: '') fastboot: error: Command failed
And it's say the same on the phone:
cmd: download: number cmd: boot cmd: getvar:has-slot:recovery cmd: getvar:max-download-size cmd: getvar:is-logical:recovery cmd: download: another number cmd: flash:recovery Mismatched partition size (recovery)
PS²: I'm not sure if it's recognize in the good way, since, when I try the command
sudo ./fastboot devices, it's listed as
ZL5225HPHW Motorola Fastboot Interface, but I'm not sure that the Motorola Fastboot Interface is good or not?
PS³: Here are some more commands and the output (I made them under the guidance of @alecxs): So here is the output:
$ sudo fastboot getvar unlocked (bootloader) unlocked: not found getvar:unlocked FAILED (remote failure) finished. total time: 0.003s $ sudo fastboot getvar securestate securestate: oem_locked finished. total time: 0.009s
So, what I'm understanding is that my phone is not unlocked? How I can do that?
Thanks to @alecxs, I just don't unlock the device bootloader correctly.
I just need to run the command
fastboot oem unlock ********twice. And after that, it's working well.
Here the command and the output I have done to resolve the issue
➜ ~ fastboot oem unlock ********** (bootloader) WARNING: This command erases all user data. (bootloader) Please re-run this command to continue. OKAY [ 0.002s] Finished. Total time: 0.002s ➜ ~ fastboot oem unlock ********** (bootloader) Bootloader is unlocked! Rebooting phone OKAY [ 0.165s] Finished.
So, I run the command twice, and it works, thanks to all of you in the comments.