Change critical settings with ADB without root I am new to Android "internals". I am looking for a way to change some settings on my device, just by using ADB, with debug mode enabled, without having root on my phone (warranty issues taken seriously).

The settings I am trying to change are:


Turn ON/OFF the unknown sources.
Add specified app to device administrators and remove it at any time.
Allow / disallow notifications for specific apps.
Optimize / do not optimize battery usage for specific apps.
Give / take screen capture permissions for specific apps.
Enable / disable google scan feature.


Unfortunately I am not a Java programmer, but, if there isn't a way to do the things above with adb but there is a chance to automate these tasks by using an app, I will try to do it. I just need some directions here. Thanks.
No, you cannot change device settings with ADB unless you have root.

$ adb shell

$ settings put system test_variable test_value
Error while accessing settings provider
java.lang.SecurityException: Permission Denial

$ su
# settings put system test_variable test_value
# settings get system test_variable
test_value