Used this workaround for some time, but it isn't very flexible when working with different project. Some project can run tests longer then 10 min. Some fits in small time interval and emulator needs to be used faster then 10 min mark.
Did anyone even tried to run Jenkins in any Linux dist with such config:
*Android plugin
*In one node at least 4 executors
*Multi-configuration project with running instances parallelly.
Noticed that there are less unclosed emulator instances when less emulators are running. Basically running 1 project with 1 emulator instance never seen unsuccessful closing.
This is a known issue; without any further details or a way to reproduce it, this can't be fixed in the plugin, in Jenkins or by the Android tool developers.
https://wiki.jenkins-ci.org/display/JENKINS/Android+Emulator+Plugin#AndroidEmulatorPlugin-AVDsmaynotshutdownfullyattheendofabuild
One workaround is to periodically run a cronjob that forcibly kills any emulator processes which have been running for a certain period of time (in this case 10 minutes or longer):