Android emulator not releasing the lock - android

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!

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

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.

Related

How to stop an Android emulator from Eclipse or Emulator button?

I just wonder how do I stop or exit Android emulator if I want to modify the source code and run again?
Do I just click on the emulator the "Power" button?
Restarting the emulator is the equivalent of rebooting a phone everytime you test something.
It takes a lot of time and it's completely unnecessary (unless you're testing something that happens during reboot). Just re-run the code, Eclipse and adb will do the rest. Keep the window of the emulator open all the time, it will just re-install the apk onto it.

Eclipse connects to android debugger, but does not enter debug mode - what is wrong?

I'm failing to debug my Android app. I have set a breakpoint in the onCreate() method of an app, and starts the app in debug mode from Eclipse. The debugger successfully connects and the application and the device freezes at the point where I have set the breakpoint, but Eclipse does not give focus to the code line where it has paused.
The Run menu has all debug commands greyed out (step over, step into etc). I have opened the DDMS perspective and can see that the debugger is successfully connected. I can find my process there and stop it, and it gives the expected result on the phone. I have also tried all suggestions from this thread to no avail, but then again it tries to solve a different problem (not connecting).
Any suggestions?
more info: I have tried also the follwoing:
Uninstalling the app from the phone.
Rebooting the phone.
Restarting ADB.
Restarting eclipse
Rebooting the computer
Operating system is Windows 8. Eclipse version Juno. I have successfully debugged only days ago so there must be something I did that made this stop working.
Try going to the "Devices" View (Window > Show View > Devices).
In it, search for the process of your application, select it, and click at the button.
After that, run your application in the debug mode.

emulator doesn't show in device view in ddms

When I try to debug using one of the configurations that I've set up (for example Android233), the emulator never actually launches. I just see a little green icon in my task bar that says "launching Android233," but it never launches. I've let it sit there for hours and it never does anything. I don't know if this is related, but my emulators don't show in device view in the DDMS perspective. I have a physical Android device, which shows up in device view. My question is, what is happenin' and how can I fix it?
Thanks for taking the time to read my question :)
I thought I had the problem figured out, but it stopped working again. Here's more information: When I run my debug configuration, in the lower right corner of my Ecplipse windows it says:
"Launching MyDebugConfig (100%)" and then there's a green icon next to it.
I looked in task manager and the emulator is not in there. I looked in DDMS and my AVD is not listed and there is nothing in the LogCat or Thread or anything else for that matter. I have my debug configuration set to prompt me to pick a device, but it never does that. It just loads my AVD, even if I have my phone connected (which is visible in DDMS). I'm so stumped. I've had this problem since I started using Eclipse and I don't know what to do.
Thanks.
Go to DDMS Perspective =>Click View menu=>reset adb
If Your genymotion virtual device is not seen in android device monitor then just try this.
1. start android studio
2. start Android Device Monitor
3. Lastly start the genymotion virtual device it will appear
The emulator won't show up in the DDMS section until its running.
The emulator won't lunch probably because you misconfigured it, currently the lunch dialog of the emulator doesn't support error messages, however you can get the lunch stack trace while you try to lunch the emulator via Eclipse.
Disconnect your physical device, run your project and select the emulator. you should see an error message on DDMS console.
If you in Windows try run (after starting emulator)
adb.exe kill-server
adb.exe start-server
and wait for restarting your adb

Android Emulator boot

I'm starting android development from just three days, I have downloaded the SDK and install the platform and define the emulator, but it takes a lot of time to boot every time I run the application
Is there a way to run the emulator once and then run the application and to be updated on the emulator without closing it and re-opening it again
I'm using eclipse classic please any one try to help
Yes, just hit "Run" again, it will be reinstalled automatically if you changed code, otherwise you will see a message like "brought to front".
I recommend to not stop the emulator as long as you don't have to.
You don't need to close your emulator every time. Assuming you are using eclipse--> Right click on project-->Run-->Android application, if any changes, those will be deployed. Otherwise same screen will showup.
Yes. I usually just leave it open and launching the program from Eclipse updates the program in the emulator and launches it.
One weird thing is that the first time I launch it I get an error from Eclipse telling me that it has not been able to connect to the emulator, and the next time I launch the application a new emulator is launched. Usually I just close the first emulator, launch it again and then it works as it should.

Android Emulator SD Card Problem

I have a problem with the Android Emulator and its SD card. I am developing an application that writes files to /sdcard. Everything works fine, until I exit the emulator by clicking its close button. After restart the files are empty (size 0), but still in the directory. Of course, they have not been empty as long as the emulator runs.
This looks like a failed sdcard unplug, like with usb stick. But I am not sure, how the emulator treats the card exactly. I am starting the emulator from Eclipse, and get an error at exit, when I close the emulator.
The problem did not exist before I updated my Android plugin. I could use all my files after restarting the emulator. Moreover, the problem does not occur on the real thing. I am using the most recent Android stuff, and Eclipse 3.5.
I already tried deleting my emulators and creating a new one. I also tried shutting the emulator down with the red telephone button, but that did never complete. Of course, my app is not a service and has no threads pending at shutdown.
Any ideas, you friendly people out there?
I am currently seeing the same problem on mine using an API 4 emulator, but putting the apk on my actual android device it works fine. It only happens if I close the emulator and restart using "Debug As" or "Run As". My current workaround is to start the emulator before running / debugging my app... not shutting down the emulator prevents this from happening, although I wish I had a real fix.
The problem went away by itself. I have no idea, what caused the healing. I did not do anything particular. I just continued working.
Thanks for your attention.

Categories

Resources