Trouble with getting twrp on sony xperia m2 using cmd

Hi newbie here with another problem…

sony xperia m2 d2303 android 5.1.1

activated developermode/ usb debugging on
unlocked bootloader
updated bootloader using emma

Seen your websites howto did not work seen several dozen difrent ones kinda tired now really wanted to do this on my own.

I am trying to get twrp recovery on my sony m2 d2303 and at the final step i get this error

C:\Users\n>adb devices
List of devices attached
serialnmbr device

C:\Users\n>adb reboot bootloader

C:\Users\n>fastboot devices
serial numbr fastboot

C:\Users\n>flashboot flash recoveryC:\Users\n\Desktop\recovery_20210118.img
‘flashboot’ is not recognized as an internal or external command,
operable program or batch file.

C:\Users\n>

Stuck on this for days really tired of this have had problems with every step since i started this…

2 Likes

Ok now what u should do is put your extracted fastboot folder into downloads then type cd downloads then hit enter then type cd fastboot then enter it should give you the correct path

1 Like

Plus check your spelling it should be fastboot flash recovery then your file

1 Like

Thank you for your fast reply.

I have tried it your way is without the puting the phone in fastbootmode trough the computer? you have to do it manually right?

anyway i have done it and now i get this error

© 2019 Microsoft Corporation. All rights reserved.

C:\Users\n>cd downloads

C:\Users\n\Downloads>cd fastboot

C:\Users\n\Downloads\fastboot>fastboot flash recovery recovery_20200723.img
error: cannot load ‘recovery_20200723.img’

C:\Users\n\Downloads\fastboot>

What did i do wrong?

1 Like

So i thought about what u mentioned about the spelling and i checked and indeed i made a typo… i then tried it again using that same method and it worked.

I now have twrp recovery on my phone. however i dont understand this whole cmd thing find it kinda scary to be honest also can u explain (if u r wiling ) to me why this method worked and yours didnt ? can u explain what that other method is i did do exactlly
i really would like to learn exactlly what i did so when i do this again i wont be scratching my head…

Aslo i already found the howto on the forum but didnt really understand it see link below

the other method went like this

step 1(connect phone while on??)
adb devices (I believe if this works this shows if the phone is connected as it wil show a serial number below it)

step 2
adb reboot bootloader (to make phone go in to fastbootmode)

step 3
fastboot devices (to see if phone is stil connected while in fastbootmode???)

step 4 ()
fastboot flash recovery (then drag img file to the command screen it will auto insert the location if said file)

that is it this is somekind of simpler method orsomething but i really dont understand.

see below for how it looked like in command screen.

© 2019 Microsoft Corporation. All rights reserved.

C:\Users\n>adb reboot
error: device ‘(null)’ not found

C:\Users\n>adb reboot

C:\Users\n>adb reboot bootloader

C:\Users\n>fastboot devices
srlnmr fastboot

C:\Users\n>fastboot flash recoveryC:\Users\n\Desktop\twrp\recovery_20200723.img.img
unknown partition ‘recoveryC:\Users\n\Desktop\twrp\recovery_20200723.img.img’
error: cannot determine image filename for ‘recoveryC:\Users\n\Desktop\twrp\recovery_20200723.img.img’

C:\Users\n>fastboot flash recovery C:\Users\n\Desktop\twrp\recovery_20200723.img
sending ‘recovery’ (16268 KB)…
OKAY [ 0.580s]
writing ‘recovery’…
OKAY [ 1.906s]
finished. total time: 2.485s

C:\Users\n>fastboot reboot
rebooting…

finished. total time: -0.000s

C:\Users\n>

after this it is finally time find the right custom rom and to flash a custom rom the last step

edit
oftopic but am i also allowed to make a howto on the forum? or is that just for the pro’s on here?

2 Likes

Using the second method by using ADB commands is indeed the simpler method. If you use my tutorial and setup Minimal ADB and Fastboot how it says to in the link I posted in that tutorial, then running the commands is very simple. The only issue some people have is using Power Shell and not Command Prompt. The commands are still the same except with Power Shell you have to put .\ in front of the commands, whereas with Command Prompt you do not. Which part is confusing you, I’ll see if I can help clarify it for you.

2 Likes

I just went back and revised my ADB and Fastboot 101 tutorial a little. I see where some of it might have been slightly confusing. But like I said, if you need some help don’t hesitate to ask. Especially since I typed up the tutorial. Haha

1 Like

@Ludeawakening
Thank you for ur reply

About your cmd tutorial it is fine i am just not the smartest tool in the shed hahha i need background info or the order of how to do things forexample in my case it should be like this (taken from your cmd tutorial)

When wanting to put twrp recovery or other recoverys??? on ur android phone

connect phone while on to the computer
step 1 - open command
step 2 - to see if your phone is detected by your computer

step 3 - to make phone go in fastbootmode

step 4 - fastboot devices (to see if phone is stil connected while in fastbootmode???)

step 5 - fastboot flash recovery -enter file location like this see below-
recovery_20200723.img press enter

This is the order i have to do to get in this case twrp recovery on my phone correct?

but what would the order forexample be for like say i want to unlock the bootloader from a generic android phone is it like this ?

step 1 adb devices (shows all connected Fastboot devices)
step 2 adb reboot bootloader or adb reboot fastboot (reboots the phone back to the bootloader)
step 3 adb devices (shows all connected Fastboot devices)
step 4 fastboot oem unlock (unlocks the bootloader but some phones require a code from the manufacturer to unlock it)

like this ??? sorry if it is suppossed to be obvious orsomething
if u could add the order in what steps u would need to do to get the thing done like say see above unlockingbootloader? or other things u need regarding flashing custom rom

Also what did i do wrong when i followed gregoryaul explanation? see bellow also why did i need to typ in cd infront of everything and not the way i ended up using

Qoute./
Thank you for your fast reply.

I have tried it your way is without the puting the phone in fastbootmode trough the computer? you have to do it manually right?

anyway i have done it and now i get this error

© 2019 Microsoft Corporation. All rights reserved.

C:\Users\n>cd downloads

C:\Users\n\Downloads>cd fastboot

C:\Users\n\Downloads\fastboot>fastboot flash recovery recovery_20200723.img
error: cannot load ‘recovery_20200723.img’

C:\Users\n\Downloads\fastboot>

What did i do wrong?

Sorry for my bad english and all the qeustions hahaha

3 Likes

The steps you listed for unlocking the bootloader by using adb commands is perfect. I will go back and add that to the tutorial a little later today when I get a chance.
On the part about having issues with the C:\Users\n commands that gregoryaul explained, I’m actually not sure as I’ve never done it myself that way. I’ve always used Minimal ADB and Fastboot and used the normal adb commands like in my tutorial.

3 Likes

Oke and uh maybe howto steps in ur tutorial for other things regarding like unlocking bootloader like what steps or order and the why ?

1 Like

So i was trying to flash a custom rom for the first time and i followed the guys instructions and then somehow my phone went into bootloop ?

I fixed it by relocking the bootloader and using xperia compagion to repair the software.

i am thinking maybe i deleted something importent ? but then why would the instructions say do it ? or maybe i misinterpetet it?

see instructions below

  • There must be an unlocked boot.
  • Latest official firmware ever previously flashed – should be 18.6.A.0.182 (5.1.1), this is due to the modem partition, since it remains from the official firmware.
  • Recovery must be installed – (rus) TWRP for Sony Xperia M2 (eng) TWRP for Sony Xperia M2
  • Do Factory Reset in TWRP (necessarily, otherwise the installation over the old LineageOS inherits some errors of the old LineageOS). I recommend doing an additional cleaning (this solves the problem with «update error 7»): TWRP – Wipe – Advanced Wipe – Dalvik,System,Cache,Data.

anyway after twrp recovery seemed to have been gone aswell ? is that because of the new firmware i put on there it deleted the twrp ? i am geussing.

After i unlocked bootlaoder again and opend cmd to put twrp on my phone again but it could not see my devices for some reason i thought maybe drivers where also gone ? so i opend the driver program put it on there again and now cmd can see my phone again.

Oke so now great now i put twrp on my phone again easy peazy lemon squizy i thought since i had already done it … however i could not get it on! i kept getting the error eventually i just copied what i had posted here in the past and pasted it and enter and that did the trick but now i have no idea why it didnt work/why it did after the copy/paste
i thought i was over this but geuss not … anyone can tell me what i did wrong?
This gonna drive me crazy…

See below

C:\Users\n>adb devices
List of devices attached

C:\Users\n>adb devices
List of devices attached
xxxxxxxxxxx device

C:\Users\n>adb reboot

C:\Users\n>adb devices
List of devices attached
xxxxxxxxxxxxx device

C:\Users\n>adb reboot bootloader

C:\Users\n>fastboot devices
xxxxxxxxxxxx fastboot

C:\Users\n>fastboot flash recoveryC:\Users\n\Desktop\recovery_20210118.img
unknown partition ‘recoveryC:\Users\n\Desktop\recovery_20210118.img’
error: cannot determine image filename for ‘recoveryC:\Users\n\Desktop\recovery_20210118.img’

C:\Users\n>fastboot flash recoveryC:\Users\n\Desktop\twrp\recovery_20200723.img
unknown partition ‘recoveryC:\Users\n\Desktop\twrp\recovery_20200723.img’
error: cannot determine image filename for ‘recoveryC:\Users\n\Desktop\twrp\recovery_20200723.img’

C:\Users\n>fastboot flash recoveryC:\Users\n\Desktop\recovery_20210118.img
unknown partition ‘recoveryC:\Users\n\Desktop\recovery_20210118.img’
error: cannot determine image filename for ‘recoveryC:\Users\n\Desktop\recovery_20210118.img’

C:\Users\n>fastboot flash recovery C:\Users\n\Desktop\twrp\recovery_20200723.img
sending ‘recovery’ (16268 KB)…
OKAY [ 0.586s]
writing ‘recovery’…
OKAY [ 1.906s]
finished. total time: 2.508s

C:\Users\n>

Sorry for being such a nusance i thought i was a hackerman now hahhaha

2 Likes

You’ll get there it takes time you can watch you tube vids on everything u need to know just utilize you tube and xda you be ok​:+1::+1:

2 Likes