2

I am facing a problem when working with Android emulators, and more specifically, when working with Selendroid.

When I start Android emulator through ./android avd (selecting an AVD and clicking into start), several lock files are created into ~/.android/avd/ so that another instance of the emulator cannot be executed. When I close the emulator, clicking the cross at the top right side, those files are automatically removed.

However, if I kill the emulator by connecting through telnet and calling "kill" command, those files are not removed. As this is what Selendroid does to close the emulator, the result is Selendroid is not detecting the emulator was closed and it is facing an infinite loop.

The weird thing is Selendroid itself logs the following message: "emulator still running, sleeping 0.5, waiting for it to release the lock", so I am discarding Selendroid creators having forgotten this.

Could there be any other reason for those lock files not being removed? Help is much appreciated!

varyvol
  • 21
  • 2
  • Goto AVD -> emulator -> actions ->show on disk -> to delete all .lock files in that folder. – Krishna V May 21 '15 at 06:36
  • That is not valid for me. I want Selendroid to launch/stop the browser automatically, so I cannot be removing those files each time. – varyvol May 21 '15 at 06:57

2 Answers2

0

I made some changes to Selendroid so that lock files are removed when emulator is detected to be closed.

https://github.com/selendroid/selendroid/pull/877

varyvol
  • 21
  • 2
0

This worked for me:

Go to AVD Manager and click on the down-arrow on the right to emulator row and click Stop. This stops the emulator and you can start it again.

Vikram
  • 1,072
  • 2
  • 20
  • 33