user1063364
user1063364

Reputation: 917

How to test physical mouse on Android Emulator

Android 8 adds support for pointer capture. https://developer.android.com/training/gestures/movement.html#pointer-capture

Is there any way how can I test it in android emulator? By default mouse emulates touch events, even I call requestPointerCapture with successful result.

Upvotes: 16

Views: 1549

Answers (1)

aruh
aruh

Reputation: 466

The Desktop AVDs (Android Virtual Devices) have mouse support.

The host mouse cursor is forwarded to the emulator. In my personal testing, hover events were fired in apps running on this AVD. They did not fire on phone or tablet AVDs.

Also testable with Desktop AVDs:

  • Keyboard shortcuts
  • Scrolling via Mouse scrollwheel

More information:

These AVDs are available since late 2023 (see blogpost above).

Upvotes: 1

Related Questions