As a general rule, everything works fine, but then sometimes either Eclipse or my Android emulator decides to be a jerk and refuses to work.
I open the AVD Manager in Eclipse. I choose which AVD I want and click Start. The emulator starts up and it goes through the loooong process of booting. It finally finishes booting and then for some reason, it immediately reboots and goes through the looong process of booting again. Once it boots the second time, Eclipse loses track of it. It is no longer lists in the Devices tab and I can’t install my app or run it on that emulator. If I kill the emulator and try to start it over, then I get the exact same behavior. It’s incredibly frustrating.
There are no messages happening in the console to explain the behavior. Any idea why this is happening?
That’s a known issue when adb starts before the emulator. I don’t know the real reason, but a quick workaround is to restart adb in the command prompt (with the emulator running)
> adb kill-server > adb start-server
> adb devices
will return the emulator and Eclipse will be able to install the app.
While in Eclipse, choose Window->Show View->Devices.
If you can’t see the emulator on the newly opened window choose the down-arrow icon in the same window (near the minimize and maximize buttons) and from the dropdown menu select “Reset ADB”.
The alternative is to open CMD.exe and type the following two commands (change the ADB directory as necessary):
C:\Program Files\Android\android-sdk\platform-tools\adb.exe kill-server C:\Program Files\Android\android-sdk\platform-tools\adb.exe start-server
I’ve seen this too. If you kill and restart the adb server, Eclipse should then see it.
> ./adb kill-server > ./adb start-server
tried these commands in mac os x / eclipse – works, but it also kills the actual devices and you have to unplug/plug them back in to get them back.