Friday, June 8, 2012

Solution for ADB error: more than one device and emulator


Have you encountered error message of "error: more than one device and emulator" while communicating Android device with adb commands? The reason behind this is the adb tool is already connected to your Android device by itself and entering the command: adb connect localhost will result in adb connecting with 2 emulator/device instances. So in further executing adb commands like sending files and installing apk applications to your Android device will be responded with this error message.

What to do after this error message shows up?
Enter: adb devices and you should see something like this below:
List of devices attached
emulator-5554 device
localhost:5555 device
Enter: adb kill-server to disconnect localhost:5555. Now you can run adb commands to your Android device without "adb connect localhost" command line.

How to overcome it?
It might not be the best answer. ADB tool behaves weirdly on my computer as it connects to my Android VM automatically and sometimes it don't. So it is advisable to execute this command: adb devices first to see the list of devices attached with adb.

If there is nothing under "List of devices attached", run adb connect localhost to connect.

If there is device like "emulator-5554 device" under "List of devices attached", adb is already connected the particular device. Without the need to enter "adb connect localhost", you can straightly operate commands to your Android device such as adb push, adb pull, adb install, and etc.

That's how I solve this adb connection error between computer and Android-x86 Virtual Machine.

7 comments:

  1. Shubhkirti SharmaAugust 4, 2012 at 1:45 AM

    It shows an error that the device is offline
    and when i type adb devices it shows
    List of devices attached
    emulator-5554 offline
    localhost:5555 offline

    ReplyDelete
  2. Hi, does you Android VM have Internet connection? adb tool requires that.

    ReplyDelete
  3. Tom Korawit ChamkraiDecember 24, 2012 at 7:11 PM

    I want to get rid of the "emulator-5554 device". How do I do that?
    I'm new to this whole thing.

    ReplyDelete
  4. had this problem. uninstalled bluestacks. resolved.

    ReplyDelete
  5. thanks really helpful thumbs up

    ReplyDelete
  6. if you need bluestacks and don't want to uninstall, just kill all processes about bluestacks. ;-)

    ReplyDelete