Is there any way to test multi-touch on the Android Emulator?
Asked Answered
R

11

63

Can multi-touch events be tested on the Android Emulator? Or is there any way to test this without an actual device? I am using the 2.0 sdk and want to test zoom-in/zoom-out with two fingers.

Recrimination answered 13/5, 2010 at 9:5 Comment(0)
C
36

UPDATE:

Yes, now there is (not for the 2.x Android, but the latest ones).

In case people still searching with this function, if you are using default emulator from android studio, for mac user you can hold command button, and for windows/linux i believe it is alt button while left clicking with your mouse – HendraWD

And for Linux, it's Ctrl + left click (however, I don't know if it's the same on Windows, so HendraWD may be right about that one)

Plus another thing you can do (with Android 4.0+) is pipe touch events through one device into the emulator. This is helpful if you only have one device, but would like to test those same touch events on other versions/dimensions of Android. (See http://tools.android.com/tips/hardware-emulation)

In any case, these are just workarounds, if multitouch is important for your app, I would still recommend that you go to an Android Developer user group with your laptop and ask for help to test your app on the spot. Your fellow developers can be super helpful with this.

In my groups, we share phones all the time (especially since most of us don't own all the different Android handsets out there). And if you don't have an Android user group in your area, assuming you live in a large enough metropolitan area, consider possibly starting such a group yourself. You're most likely not the only one who will need help with this stuff.

Common answered 13/5, 2010 at 9:5 Comment(6)
This answer is obsolete since ADT 17.Goosy
Yes Paul, but for someone "without an actual device" to pipe touch events from, the problem remains even with your solution. tools.android.com/tips/hardware-emulation Although what you're saying is still definitely worth mentioning and worth consolidating into a comprehensive answer. After all, my original answer is a community wiki. That marking enforces the fact that I receive absolutely no karma from it, but at the same time it ensures that it can still get updated by others as new partial workarounds for testing multi-touch functionality on an emulator get added over time.Common
Yes, you are correct in pointing out that the OP specifically asks for a method without using a physical device.Goosy
In case people still searching with this function, if you are using default emulator from android studio, for mac user you can hold command button, and for windows/linux i believe it is alt button while left clicking with your mousePycnometer
for me, holding the ctrl key while click/dragging works on a recent install of android studio on WindowsSibell
On macOS 14.4.1, I needed to launch the emulator outside of Android Studio to get two-finger pan gestures to work with cmd+right-click, per this comment from Google: issuetracker.google.com/issues/218885169#comment3Lout
C
68

I finally discovered how to do a pinch-zoom on the Android emulator for Android Studio 3.2. This was hard to find, but hope it helps someone.

  • move your mouse to where you want the centre of the pinch zoom. (do NOT press the mouse button)
  • press SHIFT (do not press the mouse button)
  • press Command (do not press the mouse button)
  • you should see a round target under your mouse (you haven't pressed the mouse button yet, have you)
  • move your mouse away from this first location to where you want your second "finger"
  • now you can press/drag your mouse to do the pinch/zoom

That was easy - or not.

Capital answered 27/11, 2018 at 22:35 Comment(3)
What about two finger scrolling? The gesture used for tilting the map in Google Maps.Phane
On Windows, it's CTRL instead of SHIFT+CMDOrganon
If you are ok to have the second finger start at the same place as the first finger (a common case) then the instructions can be simplified to: Move your mouse pointer to the desired pinch point then press and hold SHIFT (no clicking yet). Now do the normal holding of CTRL (windows) or CMD (mac) together with a mouse left click drag to pinch.Larentia
C
36

UPDATE:

Yes, now there is (not for the 2.x Android, but the latest ones).

In case people still searching with this function, if you are using default emulator from android studio, for mac user you can hold command button, and for windows/linux i believe it is alt button while left clicking with your mouse – HendraWD

And for Linux, it's Ctrl + left click (however, I don't know if it's the same on Windows, so HendraWD may be right about that one)

Plus another thing you can do (with Android 4.0+) is pipe touch events through one device into the emulator. This is helpful if you only have one device, but would like to test those same touch events on other versions/dimensions of Android. (See http://tools.android.com/tips/hardware-emulation)

In any case, these are just workarounds, if multitouch is important for your app, I would still recommend that you go to an Android Developer user group with your laptop and ask for help to test your app on the spot. Your fellow developers can be super helpful with this.

In my groups, we share phones all the time (especially since most of us don't own all the different Android handsets out there). And if you don't have an Android user group in your area, assuming you live in a large enough metropolitan area, consider possibly starting such a group yourself. You're most likely not the only one who will need help with this stuff.

Common answered 13/5, 2010 at 9:5 Comment(6)
This answer is obsolete since ADT 17.Goosy
Yes Paul, but for someone "without an actual device" to pipe touch events from, the problem remains even with your solution. tools.android.com/tips/hardware-emulation Although what you're saying is still definitely worth mentioning and worth consolidating into a comprehensive answer. After all, my original answer is a community wiki. That marking enforces the fact that I receive absolutely no karma from it, but at the same time it ensures that it can still get updated by others as new partial workarounds for testing multi-touch functionality on an emulator get added over time.Common
Yes, you are correct in pointing out that the OP specifically asks for a method without using a physical device.Goosy
In case people still searching with this function, if you are using default emulator from android studio, for mac user you can hold command button, and for windows/linux i believe it is alt button while left clicking with your mousePycnometer
for me, holding the ctrl key while click/dragging works on a recent install of android studio on WindowsSibell
On macOS 14.4.1, I needed to launch the emulator outside of Android Studio to get two-finger pan gestures to work with cmd+right-click, per this comment from Google: issuetracker.google.com/issues/218885169#comment3Lout
O
13

Now is possible with the new version of the emulator.

To use the multi-touch feature, hold down the Alt key on your keyboard and right-click your mouse to center the point of reference or click & drag the left mouse button to zoom.

http://tools.android.com/tips/hardware-emulation

http://android-developers.blogspot.nl/2016/02/android-studio-20-beta.html

Overlay answered 11/2, 2016 at 13:37 Comment(2)
Dunno how this wasn't more upvoted. Note that my emulator currently uses ctrl-left drag to zoom, and I can't get it to change center, but hey, better than nothing. Also, ctrl-right drag is two-finger pan.Knuckle
Looks like the emulated pinch is always centered on the screen center (since 2016) android-review.googlesource.com/c/platform/external/qemu/+/…Solomon
L
2

No.

AFAIK, The emulator still does not have any multi-touch detection driver (saw the code at https://android.googlesource.com).

Lydie answered 13/5, 2010 at 10:58 Comment(0)
G
2

Since ADT 17, it is possible to use a physical Android 4.0 device to send multitouch gestures to the emulator. See Android's instructions here.

Goosy answered 28/2, 2013 at 14:51 Comment(1)
That site has apparently been taken down. Wayback link: web.archive.org/web/20231121000914/http://tools.android.com/…Stingo
J
2

Happy to know that we got Multi-touch emulators in Android too, so took this opportunity to make Androiders aware who is not yet.

You can test it by making following updates to your current development tools:

  1. updated my Android Studio from 2.0 preview 4 to 2.0 preview 5.
  2. updated my Android SDK tools to 25.0.2 rc3
  3. Updated my Android 6.0 Google APIs Intel x86 Atom_64 System Image to Revision 12
  4. Project level dependency to classpath 'com.android.tools.build:gradle:2.0.0-alpha5'

PS: PLEASE DO NOT UPDATE NOW, as it contains a bug I have spotted one. And its a serious bug. It is interfering in our development routines. You might want to checkout my question here.

Jurat answered 21/1, 2016 at 16:36 Comment(0)
H
2

In Default Android Studio Emulator on WINDOWS:

1- Use Ctrl Key to show multi-touch handles and hold it.

2- Press left click and move mouse to perform action.

Note: if you pressed Ctrl and handles not appeared, then: open emulator settings > Settings Tab > Set "Send Keyboard shortcut to" to "Emulator Controls (Default)".

Hydrokinetics answered 10/3, 2021 at 5:38 Comment(1)
Nice, it was the same for mac os, the right click represented the double finger to dragPercipient
D
2

Some of the answers are outdated or perhaps they depend on emulator version, so in my case (emulator running on Windows) it's how you do it:

  • press shift
  • press ctrl
  • use left mouse button to zoom in / out or rotate
Doloresdolorimetry answered 7/6, 2022 at 12:40 Comment(1)
Pressing Shift first centers the pinch, which I had thought was (still) disabled based on another answer. Thanks.Stingo
B
1

Xamarin android player has multi touch option enabled.

Source: https://developer.xamarin.com/guides/android/getting_started/installation/android-player/

It is possible to simulate two-finger multi-touch input by holding the Alt/Option key and clicking on the screen.

To simulate a pinch-zoom press and hold the Alt/Option button and drag towards the centre of the screen (for zoom out) or away from the centre of the screen (for zoom in).

To simulate a two finger drag hold the Alt/Option + Shift while clicking and dragging on the screen.

Bernice answered 6/10, 2015 at 10:46 Comment(0)
B
1

For mac users in Android 4.2.1;

Press Shift+Command and there should be a rounded icon visible. After that you can play with it :)

Blaine answered 9/8, 2021 at 14:13 Comment(0)
S
0

For me on ubuntu double mouse click was working. First left click + fast left click and hold while moving mouse.

enter image description here

Sharpsighted answered 29/4, 2020 at 13:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.