How to enable Stay awake in the developer options using ADB?

Set the 'keep awake while plugged in' setting.

adb shell svc power stayon true  

You can enable Stay awake option without having to use UI with the following command:

adb shell settings put global stay_on_while_plugged_in 3

OK, I found a way:

adb shell am start -S com.android.settings/.Settings\$DevelopmentSettingsActivity

I used this : https://github.com/android/platform_packages_apps_settings/blob/master/AndroidManifest.xml

to find the name of the Activity I needed.

Now I have to figure out how to choose the stay awake option by createing a touch event or something...


adb shell am start -n com.android.settings/.DevelopmentSettings

Tags:

Android

Adb