Take the 2-minute tour ×

We've been looking into Android 3.1+ and its ability to read/write to USB devices connected to the OTG/Host port.

I've found some code examples that allow me to detect and read/write to a USB HID device, but at the moment, I simply don't have a physical 3.1+ compatible device to deploy and remotely debug on.

Does anyone know how I can attach my HID device to the emulator, via the PC/Eclipse so the app can detect and read/write to/from the device?

I've tried listing the currently connected USB Devices but it shows none, as you'd no doubt guess.

Any ideas?


share|improve this question
add comment

6 Answers

AFAIK this isn't possible. Android emulators do not emulate many things that exist in real devices... but this reminds me of an attempt to run ADB over Bluetooth.

This isn't a direct positive answer to your question but perhaps it can help you find a workaround the way I did: Install an "emulator" on a physical x86 netbook (dual-boot) and use the links referred to in my posts to accomplish what you are trying to do via WiFi or Bluetooth.

Hope this helps.

share|improve this answer
add comment

I have search around your problem and found steps to connect usb device to Emulator

here hope it will be usefull to you

share|improve this answer
add comment

Create android Virtual Machine on virtualBox or vm player with this image

connect usb and connect with eclipse using adb connect (ur device ip)

enter image description here

share|improve this answer
add comment

Maybe this Video can help: http://www.youtube.com/watch?v=F984AJL6p2Q

The GitHub link in the Description isn't available but maybe it brings you to right direction.

share|improve this answer
add comment

The Android emulator is based on QEMU. Even if the emulator version is so ancient, there appears to be support for passing USB devices from the host. It does not seem to be available for ARM devices though, the emulated ARM machine does not have a USB controller. (I have already tried enabling all USB host controllers for the goldfish_armv7 kernel based on Linux 3.4, without luck. The default emulator goldfish_armv7 kernel does not even have Host USB enabled.)

If you are not limited to ARM and can use x86, then I suggest to check out http://www.android-x86.org/, its images can be used with a standard QEMU i386 (or x86_64) machine. This also yields better performance by using the KVM extension on Linux.

To passthrough a USB device with of vendor ID 1234 and device ID abcd, you can run the emulator command:

emulator -avd x86-machine -qemu -usb -usbdevice host:1234:abcd

Or, when using QEMU:

qemu-system-i386 -m 1G -cdrom android-x86.iso -usb -usbdevice host:1234:abcd

You will need read/write permissions for /dev/bus/usb/XXX/YYY, for that you can create a udev rule such as:

SUBSYSTEM!="usb", GOTO="end_skip_usb"
ATTRS{idVendor}=="1234", ATTRS{idProduct}=="abcd", TAG+="uaccess"

Now, upon insertion of the USB device, your emulator should recognize a USB device. This is tested for a Linux installation with a Android x86 4.3 image.

share|improve this answer
add comment

Check here: http://developer.android.com/guide/developing/tools/adb.html It may help you!

share|improve this answer
Unfortunately the emulator does not support USB connections... developer.android.com/guide/developing/devices/emulator.html#limitations –  Gavin Oct 24 '11 at 12:19
-1 why do you bother answering when you don't know the answer and the answer you provided is worse than useless? Gavin's comment clears it up though. –  gardarh Feb 12 '13 at 17:28
add comment

Your Answer


