首页 文章

为什么必须经常重启Android Debug Bridge(adb)?

提问于
浏览
6

这就是每天发生的事情大约六次:

Android模拟器(例如CPU / API:Intel Atom(x86),目标:API级别15)运行良好一段时间,然后Eclipse在安装应用程序时显示以下错误

[2013-07-01 15:15:47 - Myapp] Failed to install myapp.apk on device 'emulator-5554': Connection refused: connect
[2013-07-01 15:15:47 - Myapp] java.net.ConnectException: Connection refused: connect
[2013-07-01 15:15:47 - Myapp] Launch canceled!

有时关闭并重新启动模拟器将解决此问题 . 但是,大多数情况下,启动模拟器会生成以下内容:

[2013-07-01 15:16:43 - Emulator] HAX is working and emulator runs in fast virt mode
[2013-07-01 15:16:43 - Emulator] emulator: warning: opening audio input failed

发生这种情况时,模拟器将显示,但它将无法工作(即无法安装应用程序) . 重置adb(DDMS>设备>重置adb)将不起作用 . 我必须去Windows任务管理器杀死adb.exe . Adb.exe将在不到20秒的时间内自动重启,一切都会好的 .

我每天多次这样做有点不舒服,所以我正在寻找一种避免adb腐败的方法 .

计算机操作系统:Windows 8 Pro

CPU:Intel i5

Eclipse:构建ID:20121004-1855

Added on 2013-07-26: 我同时在快速模式和Windows模拟器中选择了IronBlossom 's response as the answer even though it does not answer this question specifically, but it solved the problem of having to restart ADB frequently. Actually, it solved multiple problems including a very significant one - unable to run Intel'的Android模拟器 . 有一个trick可以并排运行Genymotion仿真器和Windows Phone仿真器 .

3 回答

  • 2

    尝试使用Genymotion . 它在Oracle VM上运行 .

    它甚至具有GPS和电池级功能,预先植根于超级用户应用程序 .

  • 1

    我通常使用2台计算机,其中一台是高端计算机播放Windows 8,我从来没有让adb崩溃或模拟器运行缓慢,但在我的带有i5 2415m和2GB ram的macmini上它崩溃了很多,但在我升级到5GB之后ram adb很少崩溃,我可以运行2个日食和4个模拟器,它很少崩溃 .

    所以我的意思是,也许adb没有完成,它有一些可能与内存泄漏或线程同步有关的问题,但是(再次)它只是我的经验,实际上它从来没有打扰过我 .

  • 0

    当您在设备上遇到运行时错误时,首先单击设备上的提示,然后确认已发生崩溃 . 之后再用adb ctrl c . 如果它工作,这应该打印出一些快乐的东西 .

    adb devices

相关问题