简体   繁体   中英

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.

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.

我也有同样的问题,安装SDK甚至三次作为TT,但解决方案是去文件夹android-sdk-windows,然后是platform-tools,然后双击adb并准备就绪!

使用Project / Clean清洁项目......

deleting the emulator and creating a new one did the job for me. Even in my case a faulty code or a secret infinite loop, i think is the problem. i tried out something and logcat failed to boot up since then.

Most likely you have 2 instances of Eclipse running (I did). (On Windows) Exit eclipse then check with the Task Manager if there is another eclipse. End it as well as any image name "adb".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM