UI Automator Viewer: receiving “Error taking device screenshot: null” every time from AVD device

主宰稳场 提交于 2019-12-04 03:52:35

Try it with HAXM acceleration turned off, if you can. I had to run the test using a profile that then ran the test on a physical device to get the screen shots. Essentially, if the AVD has Use GPU or Snapshot selected - even if running on a USB attached device, screenshots fail. This is a bug in uiautomator according to the developers involved with maturing the Appium platform.

Ajinkya Lokhande

In addition to answer given by Houston Haynes, the problem can happen if you have set the flags for your activity like this:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);

You can just comment the code and take the screenshots via anything(Android Studio, uiatutomatorviewer etc). Hope it helps!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!