how to set screen timeout from adb shell command on GingerBread?

10,283 views
Skip to first unread message

Shanth Murthy

unread,
Aug 24, 2011, 5:17:33 AM8/24/11
to android-porting, andro...@googlegroups.com
Thanks,
-Shanth

Hemanth(ヘマント)

unread,
Aug 25, 2011, 3:40:08 AM8/25/11
to android-porting
You could change it in the settings database using

Ex: to change it to one minute
sqlite3 /data/data/com.android.providers.settings/databases/
settings.db "INSERT INTO system VALUES
(null,'screen_off_timeout','600000');"

or

sqlite3 /data/data/com.android.providers.settings/databases/
settings.db "update system set value='600000' where
name='screen_off_timeout';"


But I find it kind of bad to be doing it this way (I can't think of
any particular reason, but it just seems hacky).

Since the settings provider exposes SCREEN_OFF_TIMEOUT , I would feel
much better using that.
http://developer.android.com/reference/android/provider/Settings.System.html#SCREEN_OFF_TIMEOUT


On Aug 24, 6:17 pm, Shanth Murthy <shanth.murth...@gmail.com> wrote:
> Thanks,
> -Shanth

Shanth Murthy

unread,
Aug 25, 2011, 5:57:51 AM8/25/11
to heman...@gmail.com, android-porting
Thanks Hemanth,
also do you know how to unlock the screen from adb, whitout user having to tap and slide it on the screen... needed to automate some test cases.

-Shanth

2011/8/25 Hemanth(ヘマント) <heman...@gmail.com>

Viorel Mirea

unread,
Aug 14, 2013, 9:41:02 AM8/14/13
to android...@googlegroups.com, heman...@gmail.com
To unlock screen you can use:
adb shell input keyevent 26
adb shell input keyevent 82

Lock screen:
adb shell input keyevent 6
Reply all
Reply to author
Forward
0 new messages