Skip to content

Root commands

Francesco edited this page Feb 14, 2018 · 9 revisions

This is a small collection of useful root commands. "root" means that you can't use them if your phone is not rooted, so don't try one if you don't know what I'm speaking about.

These commands are very comfortable if saved as Aliases.


Wifi

su -c "svc wifi enable/disable"

Mobile data

su -c "svc data enable/disable"

Enable airplane mode

su -c "settings put global airplane_mode_on 1 && su -c am broadcast -a android.intent.action.AIRPLANE_MODE"

Disable airplane mode

su -c "settings put global airplane_mode_on 0 && su -c am broadcast -a android.intent.action.AIRPLANE_MODE"

Enable bluetooth

su -c "service call bluetooth_manager 6"

Disable bluetooth

su -c "service call bluetooth_manager 8"

Reset battery stats

su -c "dumpsys batterystats --reset"

Pull down status bar

su -c "service call statusbar 1"

Clear notifications

su -c "service call notification 1"

Media Player - Next

su -c "input keyevent KEYCODE_MEDIA_NEXT"

Media Player - Previous

su -c "input keyevent KEYCODE_MEDIA_PREVIOUS"

Media Player - Stop

su -c "input keyevent KEYCODE_MEDIA_STOP"

Media Player - Pause

su -c "input keyevent KEYCODE_MEDIA_PAUSE"

Trigger tasker task

su -c "am broadcast -a net.dinglisch.android.tasker.ACTION_TASK --es task_name 'Task name'"
(I'm using two type of quotes here: single to delimit the task name, double to delimit the entire command)

Shutdown

su -c "svc power shutdown"

Reboot

su -c "svc power reboot"

Reboot recovery

su -c "svc power reboot recovery"

Enable auto-rotate

su -c "settings put system accelerometer_rotation 1"

Disable auto-rotate

su -c "settings put system accelerometer_rotation 0"

Set rotation to 0°

su -c "settings put system user_rotation 0"

Set rotation to 90°

su -c "settings put system user_rotation 1"

Set rotation to 180°

su -c "settings put system user_rotation 2"

Set rotation to 270°

su -c "settings put system user_rotation 3"

Enable battery saver

su -c "settings put global low_power 1"

Disable battery saver

su -c "settings put global low_power 0"

Show android log

su -c am start -n 'com.android.settings/.Settings\$NotificationStationActivity'

Open "My apps" page on Google Play Store

su -c am start -a 'com.google.android.finsky.VIEW_MY_DOWNLOADS' -n 'com.android.vending/com.google.android.finsky.activities.MainActivity'

Hide status bar and nav bar (full immersive mode)

su -c settings put global policy_control immersive.full=*

Show status bar and navigation bar (disable immersive mode)

su -c settings put global policy_control null*

Hide status bar

su -c settings put global policy_control immersive.status=*

Hide navigation bar

su -c settings put global

You can’t perform that action at this time.