简体   繁体   English

LogCat和Console停止使用Eclipse Android Emulator

[英]LogCat & Console stopped working with Eclipse Android Emulator

The Console and LogCat printouts stopped working in Eclipse with the Android Emulator. Console和LogCat打印输出在Eclipse中使用Android Emulator停止工作。

I'm getting the following Exception in the Console 我在控制台中收到以下异常

[2011-11-10 11:04:58 - Unexpected error while launching logcat. [2011-11-10 11:04:58 - 启动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) 尝试重新选择设备。]找不到设备com.android.ddmlib.AdbCommandRejectedException:在com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper。)的com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)找不到设备。 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(未知来源)

Usually when the emulator is loading or updating an apk there's a printout in the Console telling the status. 通常当模拟器加载或更新apk时,控制台中会有一个打印输出告诉状态。 Now the Console is just blank. 现在控制台只是空白。

I made sure the emulator is selected in the DDMS Tab. 我确保在DDMS选项卡中选择了模拟器。

I tried deleting and recreating the emulator in the AVD Manager. 我尝试在AVD Manager中删除并重新创建模拟器。 I restarted eclipse and the computer. 我重启了eclipse和电脑。 I also updated all of the android and eclipse software in hope that the problem may get fixed. 我还更新了所有的android和eclipse软件,希望问题得到解决。 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 在shell或命令提示符下运行:adb kill-server
  2. Unplug the USB cable from the device and plug it back in. 从设备上拔下USB电缆并重新插入。
  3. Open the devices view (Window -> Show View -> Other -> Android -> Devices) 打开设备视图(窗口 - >显示视图 - >其他 - > Android - >设备)
  4. Click on the device on the android devices view. 单击android设备视图上的设备。

I tested this for the emulator and it works if you relaunch the emulator instead of step 2. 我为模拟器测试了这个,如果你重新启动模拟器而不是第2步,它就可以工作。

Another way I got it to work was to restart Eclipse. 我让它工作的另一种方法是重启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). 注意:只要我从我的Android设备断开usb线缆,Logcat就会停止工作(类似于杀死模拟器)。

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. 我尝试了一些东西,从那以后logcat无法启动。

Most likely you have 2 instances of Eclipse running (I did). 很可能你有2个Eclipse运行实例(我做过)。 (On Windows) Exit eclipse then check with the Task Manager if there is another eclipse. (在Windows上)退出eclipse然后检查任务管理器是否有另一次日食。 End it as well as any image name "adb". 结束它以及任何图像名称“adb”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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