Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to launch a Genymotion emulator with the screen already unlocked?

Our team recently setup Genymotion for a Jenkins instance using the instructions here. Everything is working awesome except for functional tests, which use Robotium.

It seems that the instrumentation can't figure out how to unlock the device, which means that it is unable to find the necessary UI elements for our functional tests, causing them all to fail.

I've tried taking a snapshot of an unlocked device, restoring that snapshot, and then launching the emulator with Genymotion. However, when I do that, Genymotion gives me an error on start saying that the device is in an incompatible state and then the Jenkins run fails.

So, I'm wondering is there any way to either programatically unlock the screen or launch a Genymotion emulator such that the screen is already unlocked?

EDIT: The tests are targeting API level 10 phones.

like image 292
Jonathan Avatar asked Jan 28 '26 19:01

Jonathan


1 Answers

I discovered the solution was to add this line to our Jenkins pre-execute script.

adb shell input keyevent 82

This simulates a press of the menu key, which removes the lock screen.

like image 141
Jonathan Avatar answered Jan 31 '26 09:01

Jonathan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!