MonkeyRunner script go to 'Developer options' then check 'Stay Awake' but is not recorded

7 views
Skip to first unread message

Matthi GB

unread,
Dec 8, 2014, 5:44:54 AM12/8/14
to maven-androi...@googlegroups.com

I am doing a MonkeyRunner script that sets some settings in the android settings menu. The problem is that when I go to developer options, I need to check 'Stay Awake' and 'Allow mock locations' but when the script is finished these two are not checked anymore.

It seems that the device doesn't allow to change some settings through adb because when I do it manually it works.

device.touch(406, 336, "DOWN_AND_UP")

MonkeyRunner.sleep(2.0)

img = device.takeSnapshot().getSubImage((0, 300, 450, 80))

img.writeToFile(afterImg)

MonkeyRunner.sleep(2.0)

This is the part of the code that click on 'Stay Awake' and get an image of the result. The image show that the button is clicked. But after the script if I go back manualy I can see that 'Stay Awake' is unchecked.

William Ferguson

unread,
Dec 21, 2014, 4:39:34 PM12/21/14
to maven-androi...@googlegroups.com
I don't think this is the list you are looking for.
Reply all
Reply to author
Forward
0 new messages