Skip to main content
Commonmark migration
Source Link

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

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.

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.

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.

deleted 473 characters in body
Source Link
Firelord
  • 25.3k
  • 21
  • 126
  • 292

EditNote: 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

This one requires root access but claims to do a graceful shutdown, whatsoever that means in Android:

adb shell su -c 'am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN --ez KEY_CONFIRM true --activity-clear-task'
adb shell su -c 'svc power shutdown'       # alternative; tested on Android 5.0, 6.0.1 and 8.1.0

Anything from --ezFollowing is only for the purpose of showing some gimmicks during shutdown phase.

I came to know about this when I was looking for something particular in source code of BatteryService.java.

Note: the solutionan alternative and is tested on Android 4.2.1, 5.1.1 (CM 12.1)0 and 6.0.1 (unofficial CM 13 and stock Android). 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.

##Update##For low-level and instant shutdown

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

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

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


##Update 2

Tested on stock Android 5.0. and 6.0.1:

adb shell su -c 'svc power shutdown'

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

Edit: On Android Oreo, this works:

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

This one requires root access but claims to do a graceful shutdown, whatsoever that means in Android:

adb shell su -c 'am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN --ez KEY_CONFIRM true --activity-clear-task'

Anything from --ez is only for the purpose of showing some gimmicks during shutdown phase.

I came to know about this when I was looking for something particular in source code of BatteryService.java.

Note: the solution is tested on Android 4.2.1, 5.1.1 (CM 12.1) and 6.0.1 (unofficial CM 13 and stock Android).


 

##Update

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.


##Update 2

Tested on stock Android 5.0. and 6.0.1:

adb shell su -c 'svc power shutdown'

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

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.

added 500 characters in body
Source Link
Firelord
  • 25.3k
  • 21
  • 126
  • 292

Edit: On Android Oreo, this works:


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

This one requires root access but claims to do a graceful shutdown, whatsoever that means in Android:

adb shell su -c 'am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN --ez KEY_CONFIRM true --activity-clear-task'

Anything from --ez is only for the purpose of showing some gimmicks during shutdown phase.

I came to know about this when I was looking for something particular in source code of BatteryService.java.

Note: the solution is tested on Android 4.2.1, 5.1.1 (CM 12.1) and 6.0.1 (unofficial CM 13 and stock Android).


##Update

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.


##Update 2

Tested on stock Android 5.0. and 6.0.1:

adb shell su -c 'svc power shutdown'

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

This one requires root access but claims to do a graceful shutdown, whatsoever that means in Android:

adb shell su -c 'am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN --ez KEY_CONFIRM true --activity-clear-task'

Anything from --ez is only for the purpose of showing some gimmicks during shutdown phase.

I came to know about this when I was looking for something particular in source code of BatteryService.java.

Note: the solution is tested on Android 4.2.1, 5.1.1 (CM 12.1) and 6.0.1 (unofficial CM 13 and stock Android).


##Update

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.


##Update 2

Tested on stock Android 5.0. and 6.0.1:

adb shell su -c 'svc power shutdown'

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

Edit: On Android Oreo, this works:


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

This one requires root access but claims to do a graceful shutdown, whatsoever that means in Android:

adb shell su -c 'am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN --ez KEY_CONFIRM true --activity-clear-task'

Anything from --ez is only for the purpose of showing some gimmicks during shutdown phase.

I came to know about this when I was looking for something particular in source code of BatteryService.java.

Note: the solution is tested on Android 4.2.1, 5.1.1 (CM 12.1) and 6.0.1 (unofficial CM 13 and stock Android).


##Update

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.


##Update 2

Tested on stock Android 5.0. and 6.0.1:

adb shell su -c 'svc power shutdown'

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

added 115 characters in body
Source Link
Firelord
  • 25.3k
  • 21
  • 126
  • 292
Loading
added 936 characters in body
Source Link
Firelord
  • 25.3k
  • 21
  • 126
  • 292
Loading
deleted 68 characters in body
Source Link
Firelord
  • 25.3k
  • 21
  • 126
  • 292
Loading
Source Link
Firelord
  • 25.3k
  • 21
  • 126
  • 292
Loading