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.
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.
Sign up to join this communityTry adb shell reboot -p
to shutdown the phone.
--poweroff
:)
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.
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'
* The last version on which the command is tested upon is stock Android 6.0.1.
here is an another method, go to android shell then shutdown the phone!
adb shell
shutdown
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).
In Windows Sub-system for Android(WSA) shutdown
doesn't work instead try doing
adb shell reboot -p
or
adb shell
reboot -p
To shutdown the phone use this command on PC:
adb shell halt
Reboot
process asked for superuser access and works in CM12
Sep 26, 2015 at 16:28
Try
adb shell "input keyevent 26"
It's work for me.