Android – disappearing emulator ? Restart adb server
While developing for the Android platform has gotten a lot better in the past year, there are still some rough edges. In particular, emulators sometimes disappear from the list of attached devices (accessed via adb devices from the terminal, or within the Devices tab when in DDMS view in the Eclipse plugin). When this happens, you cannot interact with it via the terminal or Eclipse. That’s a pretty big problem.
A screen shot illustrating a running emulator that does not appear in the list of attached devices
An emulator within the devices window
To solve this, you should take the following steps:
# Device is running but not showing up [497][nicholasdunn: /Users/nicholasdunn]$ adb devices List of devices attached # Kill and restart [498][nicholasdunn: /Users/nicholasdunn]$ adb kill-server [499][nicholasdunn: /Users/nicholasdunn]$ adb start-server * daemon not running. starting it now * * daemon started successfully * # Device appears, but is listed as offline [500][nicholasdunn: /Users/nicholasdunn]$ adb devices List of devices attached emulator-5554 offline # One more invocation of adb devices should get it recognized [501][nicholasdunn: /Users/nicholasdunn]$ adb devices List of devices attached emulator-5554 device
If this happens to you frequently (it does to me), you can create an alias within your .bash_profile file (~/.bash_profile):
alias adb-restart='adb kill-server; adb start-server; adb devices; adb devices'
Reload your .bash_profile file:
source ~/.bash_profile
You can then invoke it from the terminal by typing adb-restart. Sometimes one invocation of adb devices is enough to have the emulator show up as a device; others requires two. Not sure why that is. To be safe I’m including two in the script.
Categories: Android, Uncategorized
adb, android, bug, emulator, glitch, workaround
Can you tell me where I can get the emulator for the G1
or the one shown?
Thank you
The emulator tool is bundled with the Android SDK. The one you see in the screenshot is from 1.6. If you run at level 1.5, you’ll see the Red G1 emulator skin.
There are ways to install other skins on the emulator as well, but I’ve never done that.
Thank you. Just restarting the adb was enough for me!
Great, glad it worked out for you
nice hint, thanks for helping me out!
This is a very useful tip! Thanks a lot.
Thanks a million. Saved me countless minutes (hours!) closing the emaulator down and restarting it!
In case any Windows users like me find this post in search of a way to get the emulator running properly (in my case Windows 7, 64bit with 64bit Eclipse and Java):
Start your program, then switch to the DDMS perspective (top right of the screen, if it’s not there, click “open perspective” first), on the “Devices” tab, click the little arrow on the right side and then “Reset adb” while your emulator is loading up.
It will appear in the devices list a couple of seconds later and work as intended.
even if i restart the server and then execute adb devices then also i get empty list! what to do ?
I didnt understand where to write the commands….please help!
From the terminal on a unix machine. If you have windows you might need Cygwin
oh man Thank you so much for this great post! you save my time, and now i can see my emulator appear (attached) on the tab of DDMS. Thx again