1

Is there any toolbox or app that will support issuing shutdown command via ssh to a rooted android smartphone? Note that I'm not asking how to restart Android via command line (remotely) – but to really shut it down / turn it off.

Izzy
  • 91,166
  • 73
  • 343
  • 943
Sean Lee
  • 111
  • 1
  • 1
  • 3

2 Answers2

3

reboot -p

was mentioned here which works for me on a rooted device. But someone mentioned here (see comments as well) that it's a bit harsh to simply shutdown without notice. So try something like this:

su -c 'am broadcast android.intent.action.ACTION_SHUTDOWN && sleep 5 && reboot -p'
acy
  • 459
  • 1
  • 5
  • 10
1

For me with an Android 4 device reboot doesn’t have a -p option, but there’s an alternative:

su -c "am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN"

This is what’s used by Android as well, see AndroidManifest.xml.

If you want to perform a more graceful shutdown broadcast ACTION_SHUTDOWN first, e.g.:

su -c "am broadcast android.intent.action.ACTION_SHUTDOWN && sleep 5 && am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN"
dessert
  • 111
  • 3