Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Android Debug Bridge (adb) have to be restarted frequently?

This is what happens about half a dozen times every day:

An Android emulator (e.g. CPU/API: Intel Atom (x86), Target: API level 15) works fine for a little while, then Eclipse shows the following error when an app is installed

[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!

Sometimes closing and restarting the emulator will remedy this. However, most of the times, starting an emulator generates the following:

[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

When this happens, the emulator will show up, but it will not work (i.e. apps cannot be installed). Resetting adb (DDMS > Device > Reset adb) will not work. I have to go to Windows Task Manager to kill adb.exe. Adb.exe will be restarted automatically in less than 20 seconds, and everything will be fine.

I am a bit sick of doing this many times every day, so I am seeking a way to avoid adb corruption.

Computer OS: Windows 8 Pro

CPU: Intel i5

Eclipse: Build id: 20121004-1855

Added on 2013-07-26: I selected 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's Android emulators in fast mode and Windows Emulators simultaneously. There is a trick to run Genymotion emulators and Windows Phone emulators side by side.

like image 644
Hong Avatar asked Jul 02 '13 12:07

Hong


People also ask

What is Android Debug Bridge and why it is required?

Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.

Why adb shell not working?

Make sure USB debugging is enabled and USB is physically plugged in. Make sure everything is ok with the ADB drivers, double-check the device manager. Check if the device appears in "adb devices", make sure its authorized on the device. Try actual adb shell and other relevant adb stuff.

Why is ADB not detecting my device?

It might be that the ADB issue is not with your computer but is with your Android device. In most cases, ADB cannot recognize your device because the USB debugging option is turned off on the device. Turning this option on can fix the issue for you and this is pretty easy to do.

What happens when you type adb start server?

Notes: starts the server if it is not running.


2 Answers

Try using Genymotion . It runs on Oracle VM .

It even has GPS and Battery level features, comes pre-rooted with Superuser app.

like image 191
IronBlossom Avatar answered Oct 29 '22 06:10

IronBlossom


I usually work with 2 computers, one is a High end computer playing windows 8 which I never got adb crashing or emulator running slow, but on my macmini with an i5 2415m and 2GB ram it crash a lot, but after I upgraded it to 5GB ram adb rarely get crashed, I can run 2 eclipses and 4 emulators and it rarely crashs.

So what I mean, is that maybe adb is not finished and it has some issues which may be related to memory leaks or thread synchronization, But (again but) it is just a shot on my experience, actually it never bothered me much.

like image 29
Pozzo Apps Avatar answered Oct 29 '22 05:10

Pozzo Apps