Search code examples
androidunit-testingtestingadb

Is there any way to unlock a phone's screen during testing?


I'm working on writing a test to be added to an automated test script, and I want to be able to guarantee that the phone's screen is on as part of my initialization process. I have no real preference as to how to accomplish this, so I'm fine with either ADB or Java, or whatever method might be applicable.


Solution

  • Have you seen this question?

    The answers give solutions using both code in the onCreate method or adb.