Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know if there's a way to get an Android phone to reboot into recovery mode, from the Android command line?

Note:

I do NOT have adb access.

I do NOT know the magic power-on sequence to do it from the boot loader. I've tried the common things and nothing works.

I DO have root. (And can enter commands directly on the device using a terminal emulator.)

I know it's possible, somehow, because applications like ROM Manager do it. But how?

share|improve this question
up vote 11 down vote accepted

Generally, reboot binary provides a recovery switch. After switching to root, execute this command:

/system/bin/reboot recovery

This may not work if your manufacturer doesn't support it. ROM Manager type apps uses API of Android which you can't access via Terminal Emulator directly.

share|improve this answer
1  
You shouldn't need the full path for reboot, but this is exactly right. – Matthew Read Mar 26 '12 at 17:30
1  
@MatthewRead Yup, full path is really not needed. :) But, I didn't want to leave a chance in case someone messed up with PATH variable. – SS-3 Mar 26 '12 at 17:46
    
why can i do this?? the terminal emulator gives me a error said "operation not permitted" what can i do?? Thanks – user62129 Jun 3 '14 at 11:22
    
@Otech1408 You have to have a rooted device to do this. – onik Jun 3 '14 at 12:33
    
on non rooted devices you can achieve this through adb: adb reboot recovery – divided-by-zero Apr 7 '15 at 6:39

If you're running Android KitKat or above* and have root access, you can try this command in a terminal app:

su -c 'setprop sys.powerctl reboot,recovery'
  • replace su -c with adb shell to run the command using
  • replace reboot,recovery with reboot to reboot the device
  • replace reboot,recovery with shutdown to shutdown the device

Note that all of those commands would do a low-level (unclean; not graceful) shutdown/reboot.

In Android Lollipop and above*, you can also try:

su -c 'setprop ctl.start pre-recovery'

Update

Tested on stock Android 5.0 and 6.0.1:

su -c 'svc power reboot recovery'

It worked on Android 4.4.2 as well but the reboot to recovery appeared to had followed a low-level reboot.


For Android Jelly Bean and below, SS-3's answer appears to be the only possible solution.


* The last version on which the command is tested upon is stock Android 6.0.1.

share|improve this answer
    
CM's su binary I suppose doesn't have -c argument, so first switch to root user using su and then execute the quoted command – Firelord Mar 8 at 21:44
1  
I believe it was running either cupcake or donut. Regardless, it went off to the great phone recyling centre in the sky long ago. But thanks anyway! – David Given Mar 8 at 22:17
1  
@DavidGiven : It may be appearing quite silly that I revived an old question but I did that because you didn't mention a particular Android version so I tried to use it as an opportunity to mention what would work not only for you but for other and successive Android versions as well. It also helped me in avoiding forking a duplicate question but for other Android versions. – Firelord Mar 8 at 22:21
    
Don't worry, I totally agree. I just thought it was amusing quite how dusty this question was... – David Given Mar 8 at 22:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.