6

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.

Community
  • 1
  • 1
Hong
  • 17,643
  • 21
  • 81
  • 142
  • 1
    Can we have your environment specs? (Hardware and software) – Pozzo Apps Jul 02 '13 at 12:29
  • Thank you for pointing out this that I forgot. I have just added this information. – Hong Jul 02 '13 at 12:39
  • Try what this user has done http://stackoverflow.com/questions/12891568/application-not-getting-installed-on-emulator-warning-opening-audio-input-fail. – AlexBcn Jul 02 '13 at 13:03

3 Answers3

2

Try using Genymotion . It runs on Oracle VM .

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

IronBlossom
  • 3,898
  • 3
  • 35
  • 42
  • Thank you for the info. I have just tried it. First, it crashed my PC (BSOD). After a clean reboot before starting any other applications, I ran it again, it hanged after showing a few errors. I had to resort to Alt + Ctr + Del to open Task Manger to get out of the hanging, and killed the program. I am running Windows 8 Pro on an Intel i5. – Hong Jul 06 '13 at 01:04
  • My specs are same as yours Win 8 and i5, Genymotion running smoothly. Leave your error on FAQ on Genymotion site. – IronBlossom Jul 06 '13 at 08:40
  • I updated it to the latest version, but still have errors including a fatal one. The problem seems to be that it cannot find file "andoir-x86-2.3-RC1-tx2500.iso". I searched my hard drives, but could not find it. – Hong Jul 09 '13 at 13:36
  • "andoir-x86-2.3-RC1-tx2500.iso" or "android-x86-2.3-RC1-tx2500.iso"?? Besides, Genymotion still doesn't have the support for GB(2.3). I guess you need a fresh download. Check your PATH and JAVA_HOME on environment variable. May be it needs that. Just guessing. – IronBlossom Jul 10 '13 at 09:20
  • I uninstalled VirtualBox and Genymotion, then tried to install the package again, but got the error "Unable to load VirtualBox engine". – Hong Jul 13 '13 at 15:38
  • 1
    Check out http://developerbits.blogspot.com/2013/06/installing-genymotion-for-mac-os-x.html blog post. Have you tried sending mails to the support team?!!! I guess some reference from previous installation remains which blocks the VM to regenerate any reference. Hope you find a solution. – IronBlossom Jul 14 '13 at 15:37
  • Hallelujah! It is working now. I apparently downloaded the wrong package which requires VirtualBox installed. I downloaded the full package, installed it, then updated VirtualBox to 4.2.16 per your suggestion. After a pretty lengthy configuration, it is working now! To my surprise, the speed, which I was worried about most, can certainly rival Intel's Android image using Inte's Hardware Accelerated Execution Manager (HAXM). If VirtualBox does not use HAXM, then it solves another big problem for me - HAXM excluding MS Hyper-V which I need for other purposes. Thanks a lot! – Hong Jul 14 '13 at 20:36
  • Glad it working now. Always check to make sure what you are downloading. AFAIK it doesn't use Hyper-V, so you can play safe. Moreover I found OpenGL Rendering failure on HAXM enabled emulator but not in the case of Genymotion. – IronBlossom Jul 15 '13 at 04:30
  • Genymotion seems to solve another problem of Intel Android emulator - needing to be restarted frequently even when adb does not need to. Two Genymotion emulators have been up for over 10 hours without any problem. Intel emulators never last so long. Genymotion does not appear to allow accessing Data folder where apps store data. I tried two Genymotion emulators and found this is the case for both. I check app data frequently, so I cannot completely switch to Genymotion. – Hong Jul 15 '13 at 10:06
  • what data folder you are talking about? Is it /data/data// ? – IronBlossom Jul 16 '13 at 05:03
  • Is your genymotion emulator hooked up with DDMS? If so, then you can easily browse your apps private data. If this is not the case, genymotion is pre-rooted, use a root browser to browse your apps private data. – IronBlossom Jul 17 '13 at 04:20
  • Yes, DDMS in Eclipse is the way that I use to browse and download files. Other folders such as /mnt/sdcard are fine. Do you have any recommendation for a Windows app of Android root browser? – Hong Jul 17 '13 at 10:32
  • I have confirmed the Genymotion emulators and Windows Phone emulators which use Hyper-V, can run side by side. – Hong Jul 26 '13 at 13:51
1

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.

Pozzo Apps
  • 1,859
  • 2
  • 22
  • 32
  • 1
    Thanks for sharing the information. My computer has 12GB RAM. I have just installed a bunch of updates including one for Intel x86 Emulator Accelerator V3, Android SDK 22.0.1. I will see if this has made any difference. – Hong Jul 02 '13 at 13:12
  • Well, so absolutely the ram is not the problem... I checked the link the other user has sent, and actually neither of my computers have antivirus installed. – Pozzo Apps Jul 02 '13 at 14:39
  • One day after updating everything, I can report that the issue remains without any improvement. I still have to kill ADB with Task Manager many times every day. – Hong Jul 03 '13 at 21:26
  • There is also another option on Eclipse > Device View > Down Arrow > Reset Adb =] – Pozzo Apps Jul 04 '13 at 11:08
  • As I stated in my question, I have tried that too to no avail, many times. – Hong Jul 04 '13 at 12:38
0

When you hit a runtime error on device, instead of ctrl+c'ing out of adb, first click the prompt on the device acknowledging the crash has occurred. After that then ctrl+c out of adb. If it worked this should print out something happy.

adb devices

Tom
  • 1,610
  • 1
  • 15
  • 19