eclipse 与 adb 的连接被中断 您可能需要从设备视图手动重新启动 adb
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13386457/
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
Connection with adb was interrupted You may want to manually restart adb from the Devices view
提问by Dejell
I am using Windows 7 and JDK 6.
我正在使用 Windows 7 和 JDK 6。
I downloaded the package of Android SDK with Eclipse and followed the instructions to create the first Hello World application.
我用 Eclipse 下载了 Android SDK 包,并按照说明创建了第一个 Hello World 应用程序。
However, when I stand on MainActiviy.java and click on run I get the following error in the console:
但是,当我站在 MainActiviy.java 上并单击运行时,控制台中出现以下错误:
Connection with adb was interrupted You may want to manually restart adb from the Devices view.
与 adb 的连接被中断 您可能希望从设备视图手动重新启动 adb。
I tried many answers that I saw here: 1. Restart adb server 2. Make sure that the path is to the correct JDK 3. I went over preferences and didn't see any warning or error.
我尝试了在这里看到的许多答案: 1. 重新启动 adb 服务器 2. 确保路径是正确的 JDK 3. 我检查了首选项,但没有看到任何警告或错误。
I can run the emulator- and it works fine. But it doesn't run the Hello World application.
我可以运行模拟器 - 它工作正常。但它不运行 Hello World 应用程序。
What is wrong?
怎么了?
回答by Dejell
I had to go to DDMS view, and in view menu of the devices, to choose:
我必须转到 DDMS 视图,并在设备的视图菜单中选择:
restart ADB.
重启亚行。
This made everything work fine
这使一切正常
回答by Maxim Shoustin
Here are followed list of options what you can do to try to fix that issue:
以下是您可以尝试解决该问题的选项列表:
- Run:
adb kill-Server
, afteradb start-Server
- Try to disable and after set enable USB debugging on device. While doing that pulling out the USB cable and putting it back in also helps.
- Just wait, sometimes it happens if it up slowly and Eclipse drop this error.
- Try to kill adb.exe through Task Manager. It will restart by different way.
You can try to up performance to your Eclipse (mostly for Android):
open
eclipse.ini
and set:-Xms128m -Xmx512m -XX:MaxPermSize=256m`
try to disable firewall
- Uninstall previous versions of JRE or JDK (if you have ones in additional to new that you currently use). After, restart Eclipse
- Does DDMS see your emulator? Try to restart
adb
through DDMS - Also add (if still you didn't) ADB to global path: My Computer -> Properties -> Advanced System settings -> Environment Variables -> press
New...
name: ADB
;value: <your android SDK path>\platform-tools
. after add to path %ADB%
- 运行:
adb kill-Server
, 之后adb start-Server
- 尝试禁用并在设置后启用设备上的 USB 调试。这样做时,拔出 USB 电缆并将其放回原处也有帮助。
- 等一下,有时它会在缓慢启动并且 Eclipse 删除此错误时发生。
- 尝试通过任务管理器杀死 adb.exe。它将以不同的方式重新启动。
您可以尝试提高 Eclipse 的性能(主要用于 Android):
打开
eclipse.ini
并设置:-Xms128m -Xmx512m -XX:MaxPermSize=256m`
尝试禁用防火墙
- 卸载以前版本的 JRE 或 JDK(如果您除了当前使用的新版本之外还有其他版本)。之后,重启Eclipse
- DDMS 能看到你的模拟器吗?尝试
adb
通过DDMS重启 - 还添加(如果你仍然没有)ADB 到全局路径:我的电脑 -> 属性 -> 高级系统设置 -> 环境变量 -> 按
New...
name: ADB
;value: <your android SDK path>\platform-tools
. 添加到路径 %ADB% 后
回答by iPrash
Expanding on Dejel's answer above with one change:
通过一项更改扩展了上面 Dejel 的答案:
- Window -> Open Perspective -> DDMS (DDMS could be in the "Other..." section)
- Window -> Show View -> Devices (if not already visible on the left pane)
- Under the view-meny (little downward-pointing triangle on "Devices" header) choose "Reset adb" (Restart may have been renamed to "reset" in newer versions).
- 窗口 -> 打开透视图 -> DDMS(DDMS 可以在“其他...”部分)
- 窗口 -> 显示视图 -> 设备(如果在左窗格中尚未可见)
- 在视图下(“设备”标题上的小向下三角形)选择“重置 adb”(在较新的版本中重新启动可能已重命名为“重置”)。
回答by Krupal Patel
This worked for me:
这对我有用:
simply go to device manager in your laptop or pc -> go to processes -> click on adb and -> click on end process.
只需转到笔记本电脑或 PC 中的设备管理器 -> 转到进程 -> 单击 adb 和 -> 单击结束进程。
Now go to sdk folder (it may be locate various location in your drive) and right click on adb.exe and click run as administrator.
现在转到 sdk 文件夹(它可能位于驱动器中的不同位置)并右键单击 adb.exe 并单击以管理员身份运行。
Now check if it works fine.
现在检查它是否工作正常。
回答by zackygaurav
This always works for me. Follow these steps :-
这总是对我有用。按着这些次序 :-
- Close Eclipse.
- Kill adb.exefrom Task Manager (Windows Only)
- Disconnect your device.
- Reconnect your device.
- Start Eclipse and Wait for Eclipse to build workspace.
- 关闭日食。
- 从任务管理器中杀死adb.exe(仅限 Windows)
- 断开您的设备。
- 重新连接您的设备。
- 启动 Eclipse 并等待 Eclipse 构建工作区。
P.S. This works perfectly on a Physical Device. I haven't tried it on Emulator.
PS 这在物理设备上完美运行。我没有在模拟器上试过。
回答by SULBI RAJ
Me too had the similar problem. Struggled alot to resolve and finally this worked out for me.
我也有类似的问题。挣扎了很多来解决,最后这对我有用。
Remove all the folders in the root folder of workspace(except workspace folder) like .android, .eclipse, .metadata etc
Save your platfoms to some safer place and delete the folder "adt-bundle-windows-x86-20130729"
Unzip the bundle again to some other locations
Try running the eclipse again and create an application
Run the application and see whether emulator automatically gets starting
Paste back ur platforms
删除工作区根文件夹中的所有文件夹(工作区文件夹除外),如 .android、.eclipse、.metadata 等
将您的平台保存到更安全的地方并删除文件夹“adt-bundle-windows-x86-20130729”
再次将捆绑包解压缩到其他一些位置
再次尝试运行 eclipse 并创建一个应用程序
运行应用程序,查看模拟器是否自动启动
粘贴回你的平台
This worked for me on my 4th attempt.
这在我的第四次尝试中对我有用。
回答by Drunken Master
I did some thing very simple.. I copied the adb.exe from users folder (users//android-sdks/platform-tools to tools folder under android-sdks.
我做了一些非常简单的事情..我将 adb.exe 从用户文件夹(用户//android-sdks/platform-tools 复制到 android-sdks 下的工具文件夹。
Then in preferences under Android i clicked "restore Defaults" then again browsed back to C:\Users\\android-sdks then clicked on the latest API (19) clicked ok..
然后在 Android 下的首选项中,我单击“恢复默认值”,然后再次浏览回 C:\Users\\android-sdks,然后单击最新的 API (19) 单击确定..
then it worked!!
然后它起作用了!!