I am using MonkeyRunner for Android Automation Testing on a real device and run overnight tests. During one of those extensive automated tests I have discovered that whenever MonkeyRunner takes a screenshot, a zombie process is created on the devices internal system. Here you can see below the zombie processes when I run adb shell ps
command:
As the zombie processes increase, the device becomes unresponsive and it starts hanging up. In MonkeyRunner, taking screenshot is the only way of verification. Thus, this issue is highly critical when running extensive tests that take many hours.
I have also seen this that says
The framebuffer_service is not doing a "wait" for the spawned screencap process to complete. Consequently, the child processes become zombie processes.
and suggests modifying the adb source code itself. However, I think there must be any other solution without going deep down to the source code.
Any ideas / suggestions how to solve this issue?