Android 模拟器启动但 Eclipse 无法识别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5527564/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:06:02  来源:igfitidea点击:

Android Emulator starts but Eclipse doesn't recognize it

androideclipseandroid-emulatoravd

提问by Kenny Wyland

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. I choose which AVD I want and click Start. The emulator starts up and it goes through the loooong process of booting. It finally finishes booting and then for some reason, it immediately reboots and goes through the looong process of booting again. Once it boots the second time, Eclipse loses track of it. 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.

我在 Eclipse 中打开 AVD 管理器。我选择我想要的 AVD,然后单击“开始”。模拟器启动并经历启动的 loooong 过程。它终于完成了启动,然后由于某种原因,它立即重新启动并再次经历了一个漫长的启动过程。一旦它第二次启动,Eclipse 就会失去对它的跟踪。它不再在“设备”选项卡中列出,我无法安装我的应用程序或在该模拟器上运行它。如果我杀死模拟器并尝试重新启动它,那么我会得到完全相同的行为。这是令人难以置信的令人沮丧。

There are no messages happening in the console to explain the behavior. Any idea why this is happening?

控制台中没有消息来解释该行为。知道为什么会这样吗?

回答by Aleadam

That's a known issue when adb starts before the emulator. 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(运行模拟器)

> adb kill-server
> adb start-server

Now,

现在,

> adb devices

will return the emulator and Eclipse will be able to install the app.

将返回模拟器,Eclipse 将能够安装该应用程序。

回答by Dzhuneyt

While in Eclipse, choose Window->Show View->Devices.

在 Eclipse 中,选择 Window->Show View->Devices。

enter image description here

在此处输入图片说明

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”。

enter image description here

在此处输入图片说明

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

回答by h-bomb

> ./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 中尝试过这些命令 - 有效,但它也会杀死实际设备,您必须拔掉/重新插入它们才能恢复它们。

回答by Ted Hopp

I've seen this too. If you kill and restart the adb server, Eclipse should then see it.

我也见过这个。如果您终止并重新启动 adb 服务器,Eclipse 应该会看到它。