错误“与 adb 的连接已关闭,并且发生了严重错误。”

发布于 2024-09-30 19:48:15 字数 343 浏览 9 评论 0原文

我花了几天时间尝试启动任何 Android 程序。即使“Hello World”也给我同样的错误:

“与 adb 的连接已关闭,并且发生了严重错误”。

我在 Windows XP 计算机上运行 Eclipse v3.5 (Galileo)、Google API 2.2.8。

我已经使用了我在网上可以找到的所有技巧:命令行“adb Kill-server”,DDMS“重置ADB”,我在Eclipse之前和之后启动了模拟器,并搜索了其他程序正在使用的端口。

这是怎么回事?是否存在 Eclipse、Java、ADB、模拟器以及其他可用版本的神奇组合?

I've spent days trying to launch any Android program. Even "Hello World" gives me the same error:

"The connection to adb is down, and a severe error has occurred".

I'm running Eclipse v3.5 (Galileo), Google APIs 2.2.8, on a Windows XP machine.

I've used all the tricks I can find on the web: the command line "adb kill-server", the DDMS "reset ADB", I started the emulator both before and after Eclipse, and searched for ports being used by other programs.

What is going on here? Is there a magic combination of versions of Eclipse, Java, ADB, emulator, and whatever else that works?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(30

写下不归期 2024-10-07 19:48:15

请尝试以下步骤:

  1. 如果正在运行,请关闭 Eclipse
  2. 在命令提示符下转到 Android SDK platform-tools 目录
  3. 键入 adb Kill-server在发出这些命令之前应关闭 Eclipse
  4. 然后输入 adb start-server
  5. 启动ADB服务器时没有抛出错误信息,则ADB启动成功。
  6. 现在您可以再次启动 Eclipse。

这种方式对我有用。

也重新启动手机!

Try the below steps:

  1. Close Eclipse if running
  2. Go to the Android SDK platform-tools directory in the command prompt
  3. Type adb kill-server (Eclipse should be closed before issuing these commands)
  4. Then type adb start-server
  5. No error message is thrown while starting the ADB server, then ADB is started successfully.
  6. Now you can start Eclipse again.

It worked for me this way.

Restart your phone as well!

み格子的夏天 2024-10-07 19:48:15

使用:

打开任务管理器→进程→adb.exe→结束进程→重新启动Eclipse

这对我有用。

和:

打开任务管理器→进程→eclipse.exe→结束进程→重新启动Eclipse

Use:

Open Task Manager → Processes → adb.exe → End Process → restart Eclipse

This worked for me.

And:

Open Task Manager → Processes → eclipse.exe → End Process → restart Eclipse

别闹i 2024-10-07 19:48:15

打开 Windows 任务管理器,终止名为 adb.exe 的进程,然后重新启动程序。

Open up the Windows task manager, kill the process named adb.exe, and re-launch your program.

瑾兮 2024-10-07 19:48:15

[2012-07-04 11:24:25 - 与 adb 的连接已关闭,并且发生了严重错误。
[2012-07-04 11:24:25 - 您必须重新启动 adb 和 Eclipse。
[2012-07-04 11:24:25 - 请确保 adb 正确位于 '/home/ASDK/platform-tools/adb' 并且可以执行

我意识到 Eclipse 中项目的文件夹已关闭。我扩展了目录并启动了项目。我知道这听起来像是“理所当然”。我在工作区中打开了 .java 文件,这足以让我认为该项目已打开。

[2012-07-04 11:24:25 - The connection to adb is down, and a severe error has occurred.
[2012-07-04 11:24:25 - You must restart adb and Eclipse.
[2012-07-04 11:24:25 - Please ensure that adb is correctly located at '/home/ASDK/platform-tools/adb' and can be executed

I realized the folder of the project in Eclipse was closed. I expanded the directory and the project launched. I know this may sound like a "no-brainer". I had the .java files open on the workspace, and that was enough to make me think the project was open.

寄意 2024-10-07 19:48:15

我使用 Eclipse Juno 进行了尝试,效果很好:

  • 从“运行”图标的下拉列表中,选择“运行配置”选项。
  • 确保选择了您的项目
  • 转至 Android 选项卡
  • 在“启动操作”部分下,选择“启动” 选择包名称
    瞧!尝试运行您的应用程序。

更新:它还有助于从任务管理器中终止进程 adb.exe 并重新启动它。 adb.exe 可以在这里找到:Android\android-sdk\platform-tools。

祝你好运

I tried this using Eclipse Juno and it worked fine:

  • From the dropdown of the Run icon, select option Run Configuration.
  • Make sure your project is selected
  • Go to tab Android
  • Under section Launch Action, select Launch Select the package name
    and voila! try running your application.

UPDATE: It also helps to kill the process adb.exe from the task manager and restart it. adb.exe can be found here: Android\android-sdk\platform-tools.

Good luck

做个ˇ局外人 2024-10-07 19:48:15

更新您的 Eclipse Android 开发工具。这对我有用。

Update your Eclipse Android development tools. It worked for me.

夏了南城 2024-10-07 19:48:15

确保它没有在任务管理器进程中运行。如果是这样,请结束该进程,然后从命令提示符启动它,如前面的答案所示。这对我有用。

Make sure it's not running in the task-manager processes. If so, end the process and then start it from a command prompt as in a previous answer. This worked for me.

沐歌 2024-10-07 19:48:15

在我的情况下:我有同样的警告:
与 adb 的连接已断开,并且发生了严重错误

我找到了解决方案:

adb.exe 已从:android-sdk-windows\tools\adb.exe代码> 到
android-sdk-windows\platform-tool\adb.exe

唯一的事情。将文件 adb.exe 移动到 \tools。并重新启动 Eclipse。

In my situation: I have the same warning:
The connection to adb is down, and a severe error has occured

I have found the solution:

The adb.exe was moved from: android-sdk-windows\tools\adb.exe to
android-sdk-windows\platform-tool\adb.exe.

Only thing. Move file adb.exe to \tools. And restart Eclipse.

无所的.畏惧 2024-10-07 19:48:15

我知道这个问题已经得到解答,但我想我可以补充一下,我发现问题出在我的 android-sdk 目录上的文件夹权限上。

我通过授予每个人完全控制权来测试它(狡猾,我知道......),问题就消失了。我还不确定它正在寻找的具体权限组合是什么,但我假设 Eclipse 中的某些或其他服务没有 adb.exe 的执行权限。也就是说,我对此完全是个菜鸟——只是想把它放在那里,以防其他人对此有一些见解。

我正在运行 Windows 7、64 位、4.2.0 Eclipse 和 20.0.0v201206242043 ADT。

I know this question has already been answered, but thought I might add that I found the problem to be folder permissions on my android-sdk directory.

I tested it out by granting Full Control to Everyone (dodgy, I know...), and the problem went away. I am not sure yet what the specific mix of permissions might be that it was looking for, but I assume some or other service in Eclipse didn't have execute permissions on adb.exe. That said, I'm a complete noob to this - just wanted to put it out there in case someone else had some insights into this.

I am running Windows 7, 64-bit, 4.2.0 Eclipse, and 20.0.0v201206242043 ADT.

櫻之舞 2024-10-07 19:48:15
  1. 转至具有 Android 备份文件的 Android 文件夹中可用的 cmd 文件夹平台工具中的文件夹 platform-tools

  2. 输入以下内容

    adb Kill-server
    

    adb 启动服务器
    

    然后输入

    adb 设备
    
    adb 终止服务器
    

You can now see your device。

  1. Go to the folder platform-tools in cmd folder platform tools available in the Android folder where you have Android backup files.

  2. Type the following

    adb kill-server
    

    and

    adb start-server
    

    then type

    adb devices
    
    adb kill-server
    

You can now see your device.

巡山小妖精 2024-10-07 19:48:15

这个问题困扰了我好几天,直到我终于弄清楚是什么原因造成的。情况变得如此糟糕,即使在尝试了上述所有建议后,我什至无法更新我的应用程序。

HTC Sync 还运行一个名为 adb.exe 的进程。 HTC Sync 是安装 HTC USB 驱动程序时可用的可选程序。我最近更新了 HTC 捆绑包的安装,并且之前显然没有安装 HTC Sync。在任务管理器中检查 adb.exe 的属性显示它属于 HTC Sync,而不是 Android。

当我从控制面板卸载 HTC Sync 后,问题就消失了! (它与 USB 驱动程序分开列出,以便可以保留。)我从未见过运行多个 adb.exe 实例。我很想知道人们是否必须从任务管理器中终止该进程,检查一下它是否确实是您要终止的 Android 进程?

请阅读用户评论(我也有 HTC Thunderbolt):
http://www.file.net/process/adb.exe.html

This problem has been plaguing me for days until I finally figured out what was causing it. It got so bad I couldn't even update my apps even after trying all the above suggestions.

HTC Sync also runs a process called adb.exe. HTC Sync is an optional program available when installing the HTC USB driver. I had recently updated my installation of the HTC bundle and apparently hadn't installed HTC Sync before. Checking properties on adb.exe in the Task Manager showed it to belong to HTC Sync, not Android.

As soon as I uninstalled HTC Sync from the control panel the problem disappeared! (It's listed separately from the USB driver so that can stay.) I never saw more than one instance of adb.exe running. I'm curious to know if people having to kill the process from Task Manager, check to see if it's actually the Android process you are killing?

Please read user comments (I too have a HTC Thunderbolt):
http://www.file.net/process/adb.exe.html

可可 2024-10-07 19:48:15

只需进入任务管理器(Windows 用户)并终止abd.exe(它以某种方式保持活动状态)。
之后启动Eclipse

错误

“与 adb 的连接已关闭,并且发生了严重错误”

安装 Netbeans Android 插件后出现 情况。关闭 Netbeans 后,abd.exe 进程仍然处于活动状态。当您想再次启动 Eclipse 时...您将收到错误消息。

您必须手动终止adb.exe,然后启动Eclipse

这对我有用。

Simply go in Task Manager (windows users) and kill the abd.exe (it is remaining active somehow).
After that start Eclipse.

The error

"The connection to adb is down, and a severe error has occured"

happened after installing plugin for Android of Netbeans. After closing Netbeans the process abd.exe remained active. When you want to start again Eclipse ... you will get the error.

You have to manually kill the adb.exe and then start Eclipse.

It worked for me.

┼── 2024-10-07 19:48:15

我也遇到了同样的问题,结果发现我的防病毒程序(Comodo)对 adb.exe 进行了沙箱处理,这就是它不起作用的原因。我关闭了防病毒软件,效果很好。考虑一下。

I had the same problems, and it turned out that my antivirus program (Comodo) sandboxed the adb.exe, and that is why it didn't work. I closed the antivirus, and it worked just fine. Consider that.

对你的占有欲 2024-10-07 19:48:15

我的问题是我的防火墙阻止 ADB 绑定到它想要的端口。

My problem was that my firewall was preventing ADB from binding to the port it wanted to.

一瞬间的火花 2024-10-07 19:48:15

我进入任务管理器时遇到了同样的问题

  1. ->找到adb.exe ->结束进程
  2. 进入命令提示符中的Android SDK工具目录双击adb.exe

即可

I had the same problem

  1. I entered Task manager -> find adb.exe -> end process
  2. Go to the Android SDK tools directory in Command Prompt double click adb.exe

That's all

乖乖公主 2024-10-07 19:48:15

我正在运行 Eclipse Neon2。在 Mac OS 10.12.4 上,我最近将 Android SDK 升级到最新的“SDK 工具”(v 25.2.5)、“平台工具”(v 26) 和“构建工具”(v 26) 并移动后遇到了此问题我的 Android Studio 开发项目之一。

不幸的是,这里的许多答案都不适合我。

所做的工作是在不同的文件夹中创建 Android SDK 的单独副本,然后通过“首选项 --> Android”将 Eclipse 指向它。您必须使用旧版本的 SDK,如此 SO 答案中所示。

下载单独版本的 SDK 并将其放在与主 Android SDK 不同的文件夹中后,启动 SDK 管理器(通过 /tools/android)并安装所需的“平台工具”、“构建工具”和 Android 版本。不过,这里有两件重要的事情需要注意:

  1. 确保您升级您的“SDK 工具”超出已安装的版本!

  2. 确保您安装的“构建工具”版本小于26!

否则您可能会遇到此问题< /a>.

I am running Eclipse Neon2. on Mac OS 10.12.4 and I experienced this issue after recently upgrading my Android SDK to the latest "SDK Tools" (v 25.2.5), "Platform tools" (v 26) and "Build Tools" (v 26) and moving one of my development projects to Android Studio.

Unfortunately none of the many answers here worked for me.

What did work was to create a separate copy of the Android SDK in a different folder and then point Eclipse to it via "Preferences --> Android". You will have to use an older version of the SDK as indicated in this SO answer.

Once you've downloaded the separate version of the SDK and put it in a different folder than your main Android SDK, launch the SDK Manager (via <separate-sdk>/tools/android) and install the required "Platform tools", "Build-tools" and Android versions. There are two important things to observe here though:

  1. Make sure that you do not upgrade your "SDK Tools" beyond the version that's already installed!

  2. Make sure that you install a version of the "Build tools" that is less than 26!

Otherwise you may run into this issue.

似梦非梦 2024-10-07 19:48:15
  1. 转到 Android SDK 的工具文件夹
  2. 运行 emulator.exe -avd。模拟器运行需要一些时间。
  3. 当您在模拟器上看到主屏幕后,打开 Eclipse 并再次运行您的程序...
  1. Go to the tools folder of your Android SDK
  2. Run emulator.exe -avd <your avd>. It will take some time for the emulator to run.
  3. Once you see the homescreen on your emulator, open Eclipse and run your program again...
烈酒灼喉 2024-10-07 19:48:15

我有类似的问题。我发现还有另一个 adb.exe 正在运行,它是从 BirdieSync(Thunderbird 同步工具)启动的。我发现,Windows 正在运行另一个不兼容的 adb。 EXE文件。只需将鼠标光标放在进程上方(在 Process Explorer 中),您就会看到哪个 adb.exe 已启动。

我还必须终止 BirdieSync 进程,因为它再次启动了错误的 adb.exe。

然后我就可以启动正确的 adb.exe,并且运行良好。

I had a similar problem. I found out that there was another adb.exe running which was started from BirdieSync (Sync Tool for Thunderbird). I found out with Process Explorer from Sysinternals, that Windows was running another incompatible adb.exe. Just put the mouse cursor above the process (in Process Explorer), and you'll see which adb.exe is started.

I had to kill the BirdieSync process as well, because it started the wrong adb.exe again.

Then I could start the right adb.exe, and it worked fine.

ι不睡觉的鱼゛ 2024-10-07 19:48:15

杀死神秘运行的 abd.exe 成功了。这突如其来的拦路虎让我停顿了好久。我正在执行各种命令行操作,并从我的用户文件夹中删除了锁定图标,但是直到您简单建议在任务管理器的运行进程中查找 abd 并将其杀死之前,一切都不起作用。

我发现了另一个新手障碍的答案:当主 .java 文件以外的任何文件处于活动状态时,不要运行 Eclipse。例如,如果在 main.xml 文件处于活动状态时运行它,您将收到无用的错误消息,创建一个类似于 main.xml.out 的奇怪文件,并且它不会运行。

The killing of the mysteriously running abd.exe worked. This sudden roadblock stopped me for a long time. I was doing all sorts of command line stuff and removed the lock icon from my user folder, but nothing worked until your simple suggestion of looking for the abd in the running processes of the task manager and killing it.

Another newbie roadblock I discovered an answer to: don't run Eclipse when any file other than the main .java file is active. If you run it when, for example, the main.xml file is active, you will get unhelpful error messages, an odd file created like main.xml.out, and it wont run.

这样的小城市 2024-10-07 19:48:15

我发现 SDK 的路径(Preferences* → AndroidSDK Location)是原因。我的 SDK 路径如下:

C:\Program Files (x86)\Android\android-sdk

路径中的空格是问题所在。要使其正常工作,您必须将 Program Files (x86) 更改为 Progra~2

完整的正确路径是 C:\Progra~2\Android\android -sdk

现在应该可以了。

I found the path of the SDK (Preferences* → AndroidSDK Location) was the cause. My SDK path was the following:

C:\Program Files (x86)\Android\android-sdk

The spaces in the path is the problem. To get it to work, you must change Program Files (x86) to Progra~2

The complete right path is C:\Progra~2\Android\android-sdk.

Now it should work.

寂寞花火° 2024-10-07 19:48:15

以前的解决方案可能会起作用。我解决了这个问题,下载最新的ADT(Android开发工具)并覆盖SDK文件夹中的所有文件。

http://developer.android.com/sdk/index.html

覆盖后如果这样,Eclipse 可能会警告说没有找到 SDK 的路径,进入 Preferences 并将路径更改为另一个文件夹(C:),单击 Apply ,然后再次更改并设置SDK路径并再次单击应用

The previous solutions will probably work. I solved it downloading the latest ADT (Android Developer Tools) and overwriting all files in the SDK folder.

http://developer.android.com/sdk/index.html

Once you overwrite it, Eclipse may give a warning saying that the path for SDK hasn't been found, go to Preferences and change the path to another folder (C:), click Apply, and then change it again and set the SDK path and click Apply again.

与他有关 2024-10-07 19:48:15

关闭 Eclipse

在终端中使用此命令:

sudo killall -9 adb

运行 Eclipse。

Close Eclipse

Use this in the terminal:

sudo killall -9 adb

Run Eclipse.

风流物 2024-10-07 19:48:15

如果您使用的是 Genymotion 模拟器:

请确保用于 Genymotion 的 SDK 路径也与用于 Eclipse 的路径相同。

如果这两条路径不同,也会发生此错误。

If you are using the Genymotion emulator:

Make sure that the SDK path used for Genymotion is also the same path used for the Eclipse.

This error also occurs if those two paths are different.

人事已非 2024-10-07 19:48:15

我已经尝试了上述方法,通过任务管理器结束adb进程,但没有用。但是当我以管理员身份运行 adb.exe 文件时,它工作正常。

I've tried the above methods, end the adb process through task manager and all, it didn't work. But when I ran the adb.exe file as admin it worked fine.

烧了回忆取暖 2024-10-07 19:48:15

这是我运行的用于重新启动 adb(Android 调试桥)服务器的脚本:

#!/usr/bin/env bash

## Summary: restart adb (Android Debug Brdige) server.

## adb binary full path
ADB_BIN=./adb


if pgrep adb >/dev/null 2>&1
then
    echo "adb is running"
    echo "terminating adb ..."
    $ADB_BIN kill-server
    if pgrep adb >/dev/null 2>&1
    then
        echo "did not work"
        echo "kill adb processes by killall"
        killall -9 adb
    else
        echo "terminated"
    fi
else
    echo "adb is not running"
fi

echo "starting adb ..."

$ADB_BIN start-server

echo "adb process:"

echo `pgrep adb`

echo "done"

# END

Here is a script I run to restart adb (Android Debug Bridge) server:

#!/usr/bin/env bash

## Summary: restart adb (Android Debug Brdige) server.

## adb binary full path
ADB_BIN=./adb


if pgrep adb >/dev/null 2>&1
then
    echo "adb is running"
    echo "terminating adb ..."
    $ADB_BIN kill-server
    if pgrep adb >/dev/null 2>&1
    then
        echo "did not work"
        echo "kill adb processes by killall"
        killall -9 adb
    else
        echo "terminated"
    fi
else
    echo "adb is not running"
fi

echo "starting adb ..."

$ADB_BIN start-server

echo "adb process:"

echo `pgrep adb`

echo "done"

# END
谈场末日恋爱 2024-10-07 19:48:15

上次遇到这个问题,通过adb restart解决了。如果您尝试过 adb Kill-serveradb start-server 但没有成功,您可能想尝试一下。当我再次遇到同样的问题时,我尝试了上述所有答案,但没有运气,这是最后一个尝试的选择。它确实很有魅力。

转到Android SDK管理器>> 安装必要的软件包。

Last time I faced this problem, was solved with adb restart. If you have tried adb kill-server and adb start-server with no luck you might want to try this. When again I faced the same issue I tried all the above answers, with no luck, and this was the last option to try. It did work like a charm.

Goto Android SDK Manager >> Install the essential packages.

情栀口红 2024-10-07 19:48:15

梅德内克是正确的(就我而言......)。文件已移动。

我什至找到了这个文件:

C:\Program Files (x86)\Android\android-sdk\tools\adb_has_moved.txt

它解释了这个问题。

此文件中的建议:

  1. 安装“Android SDK Platform-tools”。
  2. 另请更新您的 PATH 环境变量以
    包括“platform-tools/”目录。

maydenec is correct (in my case...). The file was moved.

I even found this file:

C:\Program Files (x86)\Android\android-sdk\tools\adb_has_moved.txt

Which explained this issue.

Suggestions in this file:

  1. Install "Android SDK Platform-tools".
  2. Please also update your PATH environment variable to
    include the "platform-tools/" directory.
勿忘心安 2024-10-07 19:48:15

它对我来说首先启动我的 AVD 模拟器(从 AVD 管理器),然后运行我的程序。这里提到的其他东西。

(但是重新启动 ADB 服务器不起作用。)

It worked for me to start my AVD emulator first (from the AVD manager), and then to run my program. The other stuff mentioned here.

(Restarting the ADB server didn't work though.)

紙鸢 2024-10-07 19:48:15

Eclipse → 首选项AndroidNDK

检查“NDK Location”路径是否设置正确,然后使用浏览按钮进行设置。

Eclipse → preferencesAndroidNDK

Check the "NDK Location" path is set correctly, and use the browse button to set it.

彩虹直至黑白 2024-10-07 19:48:15

AndroidSDK → 平台工具Kill 不起作用。

但重新启动电脑后,它就起作用了。

AndroidSDK → Platform ToolsKill did not work.

But after restarting my computer, it worked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文