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.
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"