Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LogCat & Console stopped working with Eclipse Android Emulator

The Console and LogCat printouts stopped working in Eclipse with the Android Emulator.

I'm getting the following Exception in the Console

[2011-11-10 11:04:58 - Unexpected error while launching logcat. Try reselecting the device.]device not found com.android.ddmlib.AdbCommandRejectedException: device not found at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736) at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373) at com.android.ddmlib.Device.executeShellCommand(Device.java:319) at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:100) at java.lang.Thread.run(Unknown Source)

Usually when the emulator is loading or updating an apk there's a printout in the Console telling the status. Now the Console is just blank.

I made sure the emulator is selected in the DDMS Tab.

I tried deleting and recreating the emulator in the AVD Manager. I restarted eclipse and the computer. I also updated all of the android and eclipse software in hope that the problem may get fixed. But, to no avail.

It may be related to a problem I had in my code yesterday. There was an unending loop in my code, so I had to stop the emulator mid code running.

like image 844
Joshua Wunder Avatar asked Nov 10 '11 05:11

Joshua Wunder


1 Answers

I was having a similar error and it was driving me crazy. I just got it to work by doing the following steps:

  1. In a shell or command prompt run: adb kill-server
  2. Unplug the USB cable from the device and plug it back in.
  3. Open the devices view (Window -> Show View -> Other -> Android -> Devices)
  4. Click on the device on the android devices view.

I tested this for the emulator and it works if you relaunch the emulator instead of step 2.

Another way I got it to work was to restart Eclipse. But that's not usually ideal.

Note: Logcat would stop working any time I disconnected the usb cable from my android device (similar to killing an emulator).

I recognize this might not fix your initial issue, but it might help others who stumble on this question.

like image 87
MikeC Avatar answered Sep 22 '22 07:09

MikeC