How to enable Stay awake in the developer options

2020-02-03 16:07发布

I'm trying to find a way to enable the Developer options -> Stay awake option via ADB. The solution that I found was to find a way to open developers option menu and then enable stay awake option using setevent command in ADB.

Now I'm trying to find the command that will open the developers options. I found the command that opens display options:

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

So I think that a similar command that opens developers options exists.

I will also be glad to hear about another way to enable stay awake option via ADB if there is any.

标签: android adb
5条回答
Lonely孤独者°
2楼-- · 2020-02-03 16:43
adb shell am start -n com.android.settings/.DevelopmentSettings
查看更多
祖国的老花朵
3楼-- · 2020-02-03 16:43

Okay I know it is not what MiSo was asking but I think it may be relevant, I have created an app that will enable/dissable this 'Stay awake' setting as you connect/disconnect ADB.

The code is available open-source here: ABD-Stay_Awake

查看更多
我想做一个坏孩纸
4楼-- · 2020-02-03 16:56

try this:

setprop persist.sys.usb.config mtp,adb
查看更多
叼着烟拽天下
5楼-- · 2020-02-03 17:09

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
查看更多
Anthone
6楼-- · 2020-02-03 17:10

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...

查看更多
登录 后发表回答