android debugging fails

I’m using eclipse as my chosen SDK for android development.  It’s great because I feel right at home; I don’t have to learn yet another IDE.

However, I am getting rather frustrated with trying to debug my android application.  Quite often eclipse just fails to communicate with the emulator or the device (depending on which I’ve chosen to run the application on).

I found a few tips on the developer.android website which are quite helpful.  I would also like to add a discovery of my own.  If you have two instances of eclipse running with different android applications, this does not a make a happy debugger!  So if you are having trouble with your debugger and you have two projects open, just close one.

Why do I have more than one instance of eclipse running you might ask.  Well it is simply to compare working code with new code that is similar but still in the making.

So as promised.  Here are the official tips for getting your debugger running again:

developer.android

When communication doesn’t seem to be happening between Eclipse and the emulator, symptoms can include: nothing happening when you press run, the emulator hanging waiting for a debugger to connect, or errors that Eclipse reports about not being able to find the emulator or shell. By far the most common symptom is that when you press run, the emulator starts (or is already running), but the application doesn’t start.

You may find any of these steps will fix the problem and with practice you probably can figure out which one you need to do for your particular issue, but to start with, the safest option is to run through all of them in order:

  1. Quit the emulator if it is running
  2. Check that any emulator processes are killed (sometimes they can hang, use ps on unix or mac, or task manager in the process view on windows).
  3. Quit Eclipse
  4. From the command line, type:
    adb kill-server
  5. Start Eclipse and try again

And here is the link:

http://developer.android.com/guide/appendix/faq/troubleshooting.html#eclipse

Advertisements

One thought on “android debugging fails

  1. kik for pc

    Heya i am for the first time here. I came across this board and I in finding
    It really helpful & it helped me out a lot. I’m hoping to provide something again and help others like you helped me.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s