I do Android development work using Eclipse. I work on a MacBook. Like many people doing Android development in Eclipse, I often start an application to run in the Emulator and then see nothing happen. Everything starts out fine. You receive the first few reassuring messages in the console window and then nothing. You start with something like Figure 1 and you get stuck with something like Figure 2.
Figure 1 Starting Your App
(click to enlarge)
Figure 2 – Nothing Shows in the Android Device Chooser
In Figure 2, I show the Android Device Chooser window and Eclipse, waiting to connect. You have the Emulator device window. Here, I show it after I’ve touched the emulated device screen to get it to the home screen. However, notice that you do not see an application running, and no matter how long I wait, it won’t show up. What I used to do is keep starting new devices until I get one that starts up correctly. Occasionally, I would restart all of Eclipse. Lately — let’s say the last six months or so — I have found something that gets Eclipse properly connected to the emulator. Here’s what I do.
I start a Terminal app on my Mac. (I assume that using a CMD window in Windows would also work.) I type the following.
As soon as I issue the second command, the Android Device Chooser comes back to life and detects that indeed there is a device connected. This is shown in Figure 3 below. Also note that my test app continued its start up in the emulated device so there’s now an app running there.
Figure 3 – Killing the ADB server and restarting.
I know this obvious to many people out there. However, a Google search does not necessarily get you to an answer right away. By writing this note, I know I have the answer handy. One of the reasons I write articles on this blog is to make it easy for me to remember things.
The other thing that’s funny about this is that I swear that I have tried this many times in the last couple of years and it did not always work. Maybe I did not notice that it was the one thing that worked reliably, or maybe it did not work all the time until recently. Perhaps it depends on what version of Eclipse and Android Developer Tools (ADT) and platform tools you have installed. I really don’t know, but thought I’d share my solution in case it works for others. My versions, by the way, are Eclipse Indigo and ADT version 16.0.1.