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

Help Is there any way into Safe Mode if stuck in boot loop?

UncleMike

Android Expert
Nov 15, 2009
2,321
483
Central NJ
My son's stock 2012 Nexus 7 running Android 5.0.2 is stuck in a boot loop (swirling dots) - it never progresses past this point. I can boot into (stock) recovery and wipe the cache, but this doesn't help. I also tried connecting it to a PC and repeating the process, but had no luck with that either. Lastly, I tried accessing it via ADB while stuck in the boot loop. ADB reports the device ID followed by "unauthorized". I'm not sure if I never used ADB from my machine on this tablet or not, but I'm thinking that the "unauthorized" may be resulting from it possibly not having progressed far enough into the boot process to know that my machine is authorized.

The only other thing I can think of doing short of a factory reset is booting into safe mode, but I don't think that's even possible without getting Android to boot first. Is it possible? If so, how?

Am I stuck doing a factory reset as the next step, and if that fails, flashing the factory image, or are there other non-destructive steps I can take?
 
Last edited:
What happened prior to the bootloop? Did he install/update any apps?

I'm pretty sure you're right about safe mode, you need to be in the OS to do that. I know on a previous Tegra 3 device I owned, you could boot in to safe mode if you powered on and held volume down as soon as the initial logo appeared, so you could try that?

Failing that, it's either a reset or reflashing the factory image.

You can actually flash the factory image without wiping data, you just need to edit the flash-all.bat file with notepad. Is that something you'd be comfortable doing? All you need to do is open with notepad and remove the -w from the command "fastboot -w update". (although let me double check that for you).
 
Upvote 0
Thanks. It sounds like flashing is my best only shot for recovering without losing data.

I'm using a Linux machine and the last time I flashed my own 2012 Nexus 7 (back to 4.4.4 from 5.0) I ran each of the steps in the script manually, since each line needed to be preceded with 'sudo' anyway, so I can easily change command lines or skip steps. I have to head out in a few minutes, but I'll download the factory image and give it a shot later tonight.

Thanks.
 
Upvote 0
Yeah... I just realized that the bootloader is locked. I think I'll wait until tomorrow to give him the bad news.

Am I correct in assuming that the "apply update from ADB" option in stock recovery would require that the update be appropriately signed?

I hear that Lollipop is pretty good about restoring data - or at least more so than previous versions of Android. Is there any hope I'll get a reasonable amount of app data back?
 
Upvote 0
Yeah, anything done with the stock recovery needs to be signed.

I didn't know there was an ADB option in the stock recovery. If there is, could you could try an ADB pull command to get stuff off the data partition? Long shot, but worth a go?

I'm really not sure about the restore options in lollipop, sorry. I've always been rooted and backed up/restored with titanium. Do you know if he had the backup data option checked?
 
Upvote 0
He set the tablet up a long time ago and doesn't remember if he opted to backup data or not. Oddly enough, when he first got the tablet, I rooted it and setup Titanium Backup, but when the tablet had some weird problem (I don't remember what it was), I flashed the factory image and re-locked the bootloader, thinking that a stock configuration would prevent rogue or poorly written apps from causing this type of problem.

What he remembers is that he had been playing Clash of Clans, and without closing it he opened YouTube and was watching a video. When a Clash of Clans notification appeared, he tapped it and looked away briefly. When he looked back at the screen he was at the home screen. Thinking maybe he hadn't actually tapped the notification, he tapped it again, which lead to a blank screen for 1-2 seconds, followed by the home screen. He then attempted to shutdown the tablet, which restarted instead, and never progressed past the boot animation.

I just tried the "apply update from ADB" option in stock recovery, and the tablet says "Now send the package you want to apply to the device with ADB sideload <filename>...", and running ADB devices reports the device id with "sideload" in place of where it otherwise says "unauthorized".

Apparently I can install an app this way (I remember in my early days of Android reading about people sideloading apps this way when their carrier had blocked access to the "unknown sources" option.

Any suggestions on an app to install that might get me past this issue?

Edit: Nevermind. In looking for any way around this problem (as if I'd be the first one to discover it) I saw the word "package" and thought "application package" instead of "update package". While it might be possible to create an update package that would flash the factory image without wiping the user data, getting it signed would be another story.

Of course, if you have any suggestions I'll be happy to hear them, but assuming all other options are disabled, I'll reluctantly factory reset the device.
 
Last edited:
Upvote 0
Just a follow-up...

To be more prepared for any future issues, I decided to unlock the boot loader, which I knew would factory reset the device (something I would have done even without unlocking). After unlocking, I restarted the device. A few seconds after the boot animation appeared, the screen went blank, which I took as a good sign, since that was different from the previous behavior. Unfortunately, it never went beyond that; the device was completely unresponsive. Connecting to the stock charger got no reaction, not did connecting to a PC, or long-pressing the power button.

I even popped off the back and disconnected the battery for 30 seconds and then reconnected, and still got no response to any of the above steps. I disconnected the battery again (for about 5 minutes), reconnected, then left the device connected to the stock charger for several hours. After returning to the device, pressing the power button finally showed the charging indicator. Pressing again, the device started up normally and began the setup steps that would normally follow a factory reset.

Since I had been trying to recover from the boot loop for quite a while, I'm wondering... Does the device not charge when in fastboot mode or stuck in a boot loop? That's the only reason I can think of for it not being fully charged at the time I unlocked the boot loader.

End result: so far, so good. During the setup process the device offered to restore from backups of several different devices - one of which was clearly the same tablet (with a date of three days earlier) - and seems to have covered everything, including some apps he remembers uninstalling.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones