简体   繁体   English

Android Emulator启动但Eclipse无法识别它

[英]Android Emulator starts but Eclipse doesn't recognize it

As a general rule, everything works fine, but then sometimes either Eclipse or my Android emulator decides to be a jerk and refuses to work. 作为一般规则,一切正常,但有时Eclipse或我的Android模拟器决定是一个混蛋并拒绝工作。

I open the AVD Manager in Eclipse. 我在Eclipse中打开AVD Manager。 I choose which AVD I want and click Start. 我选择了我想要的AVD,然后单击“开始”。 The emulator starts up and it goes through the loooong process of booting. 模拟器启动并通过loooong引导过程。 It finally finishes booting and then for some reason, it immediately reboots and goes through the looong process of booting again. 它最终完成启动,然后由于某种原因,它立即重新启动并再次启动looong进程。 Once it boots the second time, Eclipse loses track of it. 一旦它第二次启动,Eclipse就会失去它的踪迹。 It is no longer lists in the Devices tab and I can't install my app or run it on that emulator. 它不再是“设备”选项卡中的列表,我无法安装我的应用程序或在该模拟器上运行它。 If I kill the emulator and try to start it over, then I get the exact same behavior. 如果我杀死模拟器并尝试重新启动它,那么我会得到完全相同的行为。 It's incredibly frustrating. 令人难以置信的是令人沮丧。

There are no messages happening in the console to explain the behavior. 控制台中没有消息来解释行为。 Any idea why this is happening? 知道为什么会这样吗?

That's a known issue when adb starts before the emulator. 当adb在模拟器之前启动时,这是一个已知问题。 I don't know the real reason, but a quick workaround is to restart adb in the command prompt (with the emulator running) 我不知道真正的原因,但一个快速的解决方法是在命令提示符中重启adb(运行模拟器)

> adb kill-server
> adb start-server

Now, 现在,

> adb devices

will return the emulator and Eclipse will be able to install the app. 将返回模拟器,Eclipse将能够安装该应用程序。

While in Eclipse, choose Window->Show View->Devices. 在Eclipse中,选择Window-> Show View-> Devices。

在此输入图像描述

If you can't see the emulator on the newly opened window choose the down-arrow icon in the same window (near the minimize and maximize buttons) and from the dropdown menu select "Reset ADB". 如果在新打开的窗口中看不到仿真器,请在同一窗口中选择向下箭头图标(在最小化和最大化按钮附近),然后从下拉菜单中选择“重置ADB”。

在此输入图像描述

The alternative is to open CMD.exe and type the following two commands (change the ADB directory as necessary): 另一种方法是打开CMD.exe并键入以下两个命令(根据需要更改ADB目录):

C:\Program Files\Android\android-sdk\platform-tools\adb.exe kill-server
C:\Program Files\Android\android-sdk\platform-tools\adb.exe start-server
> ./adb kill-server
> ./adb start-server

tried these commands in mac os x / eclipse - works, but it also kills the actual devices and you have to unplug/plug them back in to get them back. 在mac os x / eclipse中尝试了这些命令 - 但是它也杀死了实际的设备,你必须重新插入/插入它们才能将它们取回。

I've seen this too. 我也见过这个。 If you kill and restart the adb server, Eclipse should then see it. 如果您终止并重新启动adb服务器,Eclipse应该会看到它。

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

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