The Android emulator has experimental supports for
For a realistic sensor emulation, the emulator uses a connection with an actual Android device running the SdkControllerSensor application. The application monitors changes in the sensors on the device, and transmits them to the emulator. The emulator then injects those changes into the guest system image. This requires Android 4.0, system image revision 2.
The SdkControllerSensor application source code is located in $SDK/tools/apps/SdkController/
ADB port forwarding is used for the data transfer between the device and the emulator.
Here is how you enable sensor emulation:
Note that port forwarding between the host and the device can be fragile. If you see that sensor events have stopped in the emulator, run the adb forward tcp:1968 tcp:1968 command again. This should restore the connection.
The emulator supports multi-touch input, as an experimental feature in r17, using a tethered Android device running the SdkControllerMultitouch appplication. The application contains an activity that monitor touch inputs and sends them to the emulator. This requires an Android 4.0 or later system image.
The activity displays the content of the emulator screens to help with interactivity. It is recommended to enable "show touches" in the Developer section of the Settings on the emulator to see exactly where the touches are sent.
The SdkControllerSensor application source code is located in $SDK/tools/apps/SdkControllerMultitouch/
Port forwarding is used again. This time the port is 1969.
Important: When creating the AVD, make sure to add the hardware property Multi-touch screen support, and set it to true.
Limitations: If the emulator runs with hardware GPU, the application running on the tethered device won't show the emulator framebuffer.