System Settings
Android 5.0+
Risk: MODIFIES_DEVICE
Keep Screen Awake While USB Charging
Prevents display from sleeping while connected to USB or AC charger.
Command Syntax
adb shell settings put secure stay_on_while_plugged_in 3
Generic Syntax:
settings put secure stay_on_while_plugged_in <0|1|2|3>
Real-World Usage Examples
Execute command
Prevents display from sleeping while connected to USB or AC charger.
adb shell settings put secure stay_on_while_plugged_in 3