• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

HTC One M8 Want to Factory Reset but stuck in Recovery

laineycks

Lurker
My phone recently crashed and partly recovered. I want to do a factory reset to clear all the data, especially the system data. However, it reboots to the white bootloader page in recovery mode. I cannot seem to wipe clean my phone. Any suggestions would be greatly appreciated. Thanks!
 
Recovery and bootloader are different things (different modules in different partitions), so can we be precise here: are you saying that when you select "recovery" from the bootloader menu it throws you back into the bootloader? If not, what does happen?

If it is unable to boot into recovery I can think of 2 possibilities: (1) one of your volume keys is stuck (in which case when it restarts it will think you are pressing that key and take you into the corresponding boot mode), or (2) your recovery partition has been damaged. In the latter case unless your bootloader is unlocked your only way of recovering will be to reflash the phone. For that we'd need to know the precise model (top of the bootloader screen), as much information as you can find about the software/hboot/baseband versions, and your cidnum. If you don't know the last of those, was the phone originally bought unlocked or through a carrier, if the latter, which carrier, and in which country was it originally sold? The reason for asking all of this is that the HTC flashing tools (ROM Upgrade Utilities, or RUUs) will only let you flash software packages that are intended for your cidnum and which contain software no older than what's currently installed, so we need to be able to work out which one might be right for your phone (if the phone is S-Off then these restrictions don't apply, but it's still important to know the model version, because e.g. the M8_U, M8_UL, M8_WHL etc all have different hardware and flashing the wrong firmware, which is possible if you are S-Off, would be bad news).
 
Recovery and bootloader are different things (different modules in different partitions), so can we be precise here: are you saying that when you select "recovery" from the bootloader menu it throws you back into the bootloader? If not, what does happen?

If it is unable to boot into recovery I can think of 2 possibilities: (1) one of your volume keys is stuck (in which case when it restarts it will think you are pressing that key and take you into the corresponding boot mode), or (2) your recovery partition has been damaged. In the latter case unless your bootloader is unlocked your only way of recovering will be to reflash the phone. For that we'd need to know the precise model (top of the bootloader screen), as much information as you can find about the software/hboot/baseband versions, and your cidnum. If you don't know the last of those, was the phone originally bought unlocked or through a carrier, if the latter, which carrier, and in which country was it originally sold? The reason for asking all of this is that the HTC flashing tools (ROM Upgrade Utilities, or RUUs) will only let you flash software packages that are intended for your cidnum and which contain software no older than what's currently installed, so we need to be able to work out which one might be right for your phone (if the phone is S-Off then these restrictions don't apply, but it's still important to know the model version, because e.g. the M8_U, M8_UL, M8_WHL etc all have different hardware and flashing the wrong firmware, which is possible if you are S-Off, would be bad news).


If I select Reset phone from Settings > Backup & reset, my phone powers down and turns on displaying the bootloader menu. When I reboot my phone, nothing has changed (i.e. my phone looks and functions as it did before I reset it). I am not prompted to set up my phone again. If through the Bootloader menu, I select Factory reset, the phone says "recovery mode" and returns me to the Bootloader menu. So the issue is that I want to factory reset my phone, but it recovers it instead.

I purchased my phone unlocked from Hong Kong, but the original carrier was 3.

M8_UL
HBOOT: 3.19.0.0000
RADIO: 1.29.214500021.12G
OS: 6.13.771.4
 
The way a phone would reset would be to go into recovery mode, so it's not doing anything instead of resetting. However, it's also not actually doing the reset.

Just to be absolutely sure, try selecting "recovery" from the bootloader. If you can't see that, select "hboot" or "fastboot", whichever is amongst the options - that will give you a different menu which should have "recovery" on it. If things are working this should take you into recovery, which on an unmodified M8 I think will look like a black screen with a red triangle (as opposed to the more common "android lying on its back"). If you get that, I think you then press power and volume up together to get the recovery menu, from which you can select the factory reset option.

If the phone doesn't go into recovery mode, but straight back to the bootloader, then your recovery partition has been corrupted in some way. If this happened spontaneously then it would be worrying, but from what you say of the phone's history it's also possible someone has tried to modify it in the past and messed this up. In that case the question is whether it says "locked" or "unlocked" at the top of the bootloader screen. If "unlocked" we can just find a compatible recovery and flash that, if "locked" it's probably a matter of finding a compatible RUU ("3" isn't the simplest one to find these for) and reflashing (which will erase everything), though I can think of a couple of alternatives (try unlocking the bootloader, which will reset the device anyway as well as letting you flash recovery, or use a utility called "fastboot", which can be installed to a computer, to erase the cache and data partitions, which is all a reset does anyway).
 
If I select recovery, it returns to the bootloader. My phone says "unlocked" at the top of the bootloader screen. How does one unlock the bootloader?
 
You use fastboot to unlock the bootloader, or relock it. Relocking is as simple as typing "fastboot oem lock" (on a computer with fastboot installed, with phone in fastboot mode and connected to the computer via USB). Unlocking involves a couple of fastboot commands and a key calculated for your phone - you can find instructions at the htcdev.com site.

Interesting that it's bootloader unlocked - normally when people say the phone was bought unlocked they mean SIM unlocked (able to use any provider's SIM cards), which is something entirely different and unrelated (unless of course the seller didn't understand that).

But OK, if the bootloader is unlocked you can try flashing a recovery. A "custom recovery", used by people who install custom ROMs, is more powerful than the stock one. You can find the image and instructions for TWRP (the most popular custom recovery for the M8) here: https://twrp.me/htc/htconem8gsm.html. Download an image from the "download links" page then follow the instructions for installing using fastboot (the only one of those methods you can use with the phone in its current state).

If you prefer to have completely stock software then we may be able to find a stock recovery image that can be flashed the same way. The trick is finding the correct one that matches your software. This XDA post includes a link to what should be the stock recovery for your software version, which can be installed using the same fastboot command as for the TWRP recovery in the previous paragraph (fastboot flash recovery recovery.img).
 
I have to admit that I am lost and having issues following these instructions. The HTCDev asked me to go to the Developer Options and select OEM unlock. But this option is not available. I also tried TWRP, but it claims my phone is not rooted. I have a Mac, and Terminal does not seem to accept the commands I enter. In fact, my Mac does not even seem to notice that my phone is connected.


You use fastboot to unlock the bootloader, or relock it. Relocking is as simple as typing "fastboot oem lock" (on a computer with fastboot installed, with phone in fastboot mode and connected to the computer via USB). Unlocking involves a couple of fastboot commands and a key calculated for your phone - you can find instructions at the htcdev.com site.

Interesting that it's bootloader unlocked - normally when people say the phone was bought unlocked they mean SIM unlocked (able to use any provider's SIM cards), which is something entirely different and unrelated (unless of course the seller didn't understand that).

But OK, if the bootloader is unlocked you can try flashing a recovery. A "custom recovery", used by people who install custom ROMs, is more powerful than the stock one. You can find the image and instructions for TWRP (the most popular custom recovery for the M8) here: https://twrp.me/htc/htconem8gsm.html. Download an image from the "download links" page then follow the instructions for installing using fastboot (the only one of those methods you can use with the phone in its current state).

If you prefer to have completely stock software then we may be able to find a stock recovery image that can be flashed the same way. The trick is finding the correct one that matches your software. This XDA post includes a link to what should be the stock recovery for your software version, which can be installed using the same fastboot command as for the TWRP recovery in the previous paragraph (fastboot flash recovery recovery.img).
 
The fastboot install method doesn't require root, and your bootloader is already unlocked. So all you need to do is install fastboot on your mac and use that to flash the recovery image.

So, step-by-step (but I'm doing this from memory, not testing):

* Download the fastboot program to your Mac from here: https://www.htcdev.com/process/legal_fastboot_mac. That will download a zip file (I did test that bit!). Move it from your downloads folder to wherever you'd like to put it, then unzip it. This will then leave you an executable called "fastboot-mac" (I rename it to "fastboot", so that for me the commands look the same as on Linux or Windows, but I'll use the name "fastboot-mac" here).

* In the terminal, cd to wherever you've put the fastboot-mac binary. I'll also assume that you've copied the recovery image to the same directory for simplicity. I'll refer to the recovery image as "recovery.img" - replace that with whatever the actual filename is when executing commands.

* Put the phone in fastboot mode and connect via usb.

* Test the connection by typing in the terminal

./fastboot-mac devices

This should respond with the serial number of your phone. If you get that, you're good to go. If not, type

./fastboot-mac

and it should respond with a list of options. If that happens but the previous command doesn't work let us know what error messages you got (also check the phone is in fastboot mode, and try with a different USB port/cable just to be sure).

* Assuming all of that is working, you can then flash your recovery (TWRP or stock) using the command

./fastboot-mac flash recovery recovery.img

It should be quite quick, but don't interrupt it if it takes longer than you expect.

And that should be all you need. If you use TWRP then it's probably simplest to boot into recovery mode and use its menu to reset (it should be fairly obvious: look for either the words "wipe" or "reset"). If you use the stock recovery you can try through the Android setting menu (which should work with stock, I've literally never used it so don't know whether it plays well with a custom recovery - I always would use recovery directly, but the stock recovery is more of a faff). If you use the stock recovery and want to do it from recovery mode you will probably get a black screen with a red triangle (possibly a droid on its back, but I think HTC normally use the red triangle). To get the actual recovery menu you need to press power and volume up together (from memory - I have mostly used custom recoveries), after which you will find options to just wipe the cache or do a factory reset.

Good luck!
 
Back
Top Bottom