79

How do I halt an android phone using adb command? I can reboot, but I don't know how to halt.

I tried shutdown -k wait command, but it did not work.

112

Try adb shell reboot -p to shutdown the phone.

  • 35
    For those who wonder what the "p" stands for: it's short for --poweroff :) – Izzy Jun 26 '13 at 7:15
  • 6
    it would have been better unix way: "shutdown" for shutdown and "shutdown -r" for reboot – Mert Akcakaya Oct 3 '13 at 14:22
  • Doesn't work for me though. Nexus 4 on Lollipop 5.0.1 (rooted), or LG P705 on ICS 4.0.3 (unrooted). I wonder if it's related to ADB version or not (mine's 1.0.32). – Andrew T. Jan 30 '15 at 5:48
  • 4
    Try adb reboot -p (leave out shell). – Caleb Xu Mar 9 '15 at 1:07
  • 2
    reboot -p only reboots my tablet. Doesn't shutdown. – JohnyTex Dec 27 '16 at 13:03
17

Note: All the following commands below require root access.

On Android Oreo, this works and does a graceful shutdown:

adb shell su -c 'am start -a com.android.internal.intent.action.REQUEST_SHUTDOWN'
adb shell su -c 'am start -n android/com.android.internal.app.ShutdownActivity'  #alternative; the aforesaid intent is supposed to be passed to this component under normal circumstances, but calling the component alone works too
adb shell su -c 'svc power shutdown'       # alternative; tested on Android 5.0, 6.0.1 and 8.1.0

Following is an alternative and is tested on Android 4.2, 5.0 and 6.0.1. I do not know about Nougat but it doesn't work for Oreo though.

adb shell su -c 'am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN --ez KEY_CONFIRM true --activity-clear-task'   # I kept this here for historical purposes only.

For low-level and instant shutdown

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

adb shell 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

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

  • "setprop sys.powerctl reboot,recovery" worked for me. Thanks! – spica Jan 17 at 3:35
4

here is an another method, go to android shell then shutdown the phone!

adb shell
shutdown

enter image description here

  • 1
    Doesn't work for me though. Nexus 4 on Lollipop 5.0.1 (rooted, even after using su), or LG P705 on ICS 4.0.3 (unrooted). I wonder if it's related to ADB version or not (mine's 1.0.32). – Andrew T. Jan 30 '15 at 5:51
  • Doesn't work for me on an MIUI Redmi 3. "shutdown: not found". – andrew lorien Dec 14 '16 at 3:18
0

To shutdown the phone use this command on PC:

adb shell halt
  • 1
    Doesn't work on stock 5.0 Galaxy S5 & 5.1 nexus 7, Interestingly when run in CM12 Reboot process asked for superuser access and works in CM12 – Manubhargav Sep 26 '15 at 16:28

protected by Community Jan 25 '17 at 7:41

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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