Appium leaves android device in an unresponseive state after a test completes

Just set up my first Appium test using the ContactManager sample app.

I was really impressed at how quickly and easily I was able to integrate Appium into our existing Selenium WebDriver based test framework.

Hooked up my Nexus 5 and amazingly the test worked on the very first try.

I have run into one significant issue, though:

If I start the test while the phone is on and unlocked, it runs fine and the AUT closes when the test is complete (call to IWebDriver.Quit()). This leaves the phone in a normal unlocked state.

However, if I start the test while the phone is locked, the test runs as usual, but when it’s complete it leaves the phone in an odd state:

  • Screen is Black, only Status Bar and Nav Buttons are displayed.
  • Nav Buttons don’t seem to do anything.
  • I can open the notifications/quick settings shade, but I can’t open anything else from there (even the basic system settings UI).
  • Turning the screen off and back on does not revert me to the lock screen. I’m still stuck at this black screen.
  • Power menu still works, and the only way I’ve found to get out of this state is to reboot the phone.

Basically, it seems like there’s a blank black screen being drawn over whatever the phone is trying to do and only a few core UI elements like the NavBar and StatusBar are able to draw over it.

Here are the relevant stats:
Device: Nexus 5
Android Version: 5.1
Test Server: Windows 7 x64
Appium Version: 1.3.7.2
Selenium WebDriver Version: 2.45.0.0 (.NET)
Appium DotNet Driver Version: 1.2.0.8

I get the same issue. My phone becomes unresponsive after the test completes and it only happens if the phone is locked prior to a test run. I am using Appium 1.4

The same problem here, but this problem is not depending of locking screen.

Nexus 6 (Motorola)
Android 5.1
Appium 1.3.7, 1.4.0
Windows 7 x64
Ruby
appium_console (1.0.4, 1.0.3)
appium_lib (7.0.0, 6.0.0)

After some time of doing nothing (30 min or more), sometimes device start working! There may be error from application, like “App isn’t respondind, do you want to close it?”, or application is closed or is in initial screen.

This “black screen” sometimes is when tests failed because of exception in application, but sometimes without any reason, in the middle of testing.

When I run the same tests on the same application, but on different device (Samsung Galaxy S5 Android 5.0, HTC Sense 6.0 Android 5.0.1 etc.) - it works without “black screen”.

Something is wrong with Nexus???

Yeah, this is a serious problem. It’s happening on my Nexus 6 as well.

Happens on every google device I use for automation. Nexus 6, Android One and a Nexus 4. So odd.

We have disabled locking screen in Android settings - it resolved problem, but now I have to remember to turn off screen when I finish working.

Experiencing this frequently. I reboot the device via “adb reboot” but this is only viable while I’m developing tests, not executing a suite.

Did anyone log a bug for this?

Mac OSX 10.10.5
Appium server 1.4.16
Appium-Python-Client 0.20

Same thing here…

I have to really be careful for the app to close in a clean way… if not black screen…