Eclipse、adb 和 ddms 未检测到 Android 模拟器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8469723/
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 17:26:05  来源:igfitidea点击:

Eclipse, adb, and ddms not detecting Android Emulator

androideclipseandroid-emulatoradbddms

提问by Xantham

I wanted to try my hand at programming android devices, so I followed the directions from the android website, installed the sdk, the java sdk, and eclipse. My computer is Windows 7 64-Bit, but I have the 32-bit Java SDK and Eclipse installed since hearing that there are issues with the 64-bit versions.

我想尝试编写 android 设备,所以我按照 android 网站上的说明安装了 sdk、java sdk 和 eclipse。我的电脑是 Windows 7 64 位,但我安装了 32 位 Java SDK 和 Eclipse,因为听说 64 位版本存在问题。

I am running the most recent version of the Android sdk, 4.0 R15.

我正在运行最新版本的 Android sdk,4.0 R15。

I believe followed all of the instructions for installation, but when I load up a sample (Lunar Lander in this case), it loads the emulator, but will not install the app to it. ADB does not show the emulator listed when I use "adb devices", the DDMS perspective in eclipse does not detect any device either. In the emulator I have activated the USB debug setting in the developer area.

我相信遵循了所有安装说明,但是当我加载示例(在本例中为 Lunar Lander)时,它会加载模拟器,但不会将应用程序安装到其中。当我使用“adb devices”时,ADB 没有显示列出的模拟器,eclipse 中的 DDMS 透视图也没有检测到任何设备。在模拟器中,我已经激活了开发者区域中的 USB 调试设置。

I have tried restarting the adb server, and have reinstalled a few times.

我试过重新启动 adb 服务器,并重新安装了几次。

I even copied what one guy did on a youtube tutorial for a hello world program, and it still would not load to the device.

我什至复制了一个人在 youtube 教程中为 hello world 程序所做的事情,但它仍然无法加载到设备上。

Does anybody have any idea how to get the emulator and eclipse talking so I can actually run and debug programs?

有没有人知道如何让模拟器和 Eclipse 对话,以便我可以实际运行和调试程序?

回答by Andrey Regentov

Try to adb kill-serverand then do adb command like adb deviceswhich will start adb again.

尝试adb kill-server然后执行 adb 命令adb devices,这将再次启动 adb。

It helps in my case.

它对我有帮助。

回答by hipokito

Best solution I found is this:

我找到的最佳解决方案是:

  1. Open DDMS(Window->Open Perspective->DDMS)
  2. In DDMS in the left side there is a Devices tab, a little below there is a list of items, choose little triangle called View Menu, under it find Reset adb and launch it.
  1. 打开DDMS(窗口->打开透视图->DDMS)
  2. 在左侧的 DDMS 中,有一个 Devices 选项卡,在下方有一个项目列表,选择名为 View Menu 的小三角形,在它下面找到 Reset adb 并启动它。

After that I get my emulator detected.

之后,我检测到我的模拟器。

回答by Priya Kathir

Create new AVD following Window->AVD Manager->New (Give a name to your device & select the target) -> Create AVD.

在窗口->AVD 管理器->新建(为您的设备命名并选择目标)-> 创建 AVD 之后创建新的 AVD。

Select the AVD that you created and Click Start to launch the devie.

选择您创建的 AVD,然后单击开始以启动设备。

Only on launching, the device is displayed under adb devices.

只有在启动时,设备才会显示在 下adb devices

回答by Arran Ubels

I noticed that if you allocate a lot of memory to the device it can "freeze" when starting, if frozen for a sufficient period it disappears from the adb devices list. Try reduce the memory footprint of the application?

我注意到,如果您为设备分配了大量内存,它会在启动时“冻结”,如果冻结足够长的时间,它会从 adb 设备列表中消失。尝试减少应用程序的内存占用?

回答by Ghost

For starters, I think you can try the 64 bit versions of Java and Eclipse for Windows. I've Windows 7 64-bit edition, 64-bit java and eclipse versions and all work very well, without any glitches. I however have a question. Where exactly have you installed Android? I mean, using the installer that's available in the Android Developer website. If you've installed it in C:\Program Files, then try re-installing it in C:\ directly instead of Program Files directory. I had faced issues when the directory was C:\Program Files and then I changed it to C:\ .

对于初学者,我认为您可以尝试 64 位版本的 Java 和 Eclipse for Windows。我有 Windows 7 64 位版本、64 位 java 和 eclipse 版本,并且都运行良好,没有任何故障。不过我有一个问题。你究竟在哪里安装了Android?我的意思是,使用 Android Developer 网站上提供的安装程序。如果您已将其安装在 C:\Program Files 中,则尝试直接将其重新安装到 C:\ 而不是 Program Files 目录中。当目录为 C:\Program Files 然后我将其更改为 C:\ 时,我遇到了问题。