101

I have an application in which I need to implement image editing, which also includes pinch zooming. I am done with pinch zooming but I can test this only on device, not on emulator.

Is there any way for testing pinch zooming in android emulator, any shortcut key or any other way?

Pavel Chuchuva
  • 22,633
  • 10
  • 99
  • 115
vipin
  • 2,851
  • 4
  • 18
  • 32

15 Answers15

160

With a mouse:

Press and hold Ctrl and press and hold left mouse and while doing that move your mouse.

With a trackpad:

Press and hold Ctrl and press and hold your trackpad and move with a finger to the LEFT and RIGHT (not up and down).

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
yowbro
  • 1,609
  • 2
  • 10
  • 2
  • Is this for normal emulator or genymotion ? – kiranpradeep Feb 13 '15 at 12:46
  • @yowbro, How did you figure this out? – Pacerier Jul 01 '15 at 13:41
  • Double-clicking worked for me with the regular mouse and did not use trackpad. CTRL did nothing to change it. – Max Candocia Apr 06 '16 at 19:03
  • As of Android Studio 2.1.2, it works. Hold CTRL + left-click to set the gesture center, then either drag away from center to zoom out, or move (not drag!) away from center, *then* drag towards the center to zoom in. For me, the cursor changed to a Holo-blue target icon at the center, with dashed lines indicating the emulated zoom pointers. – MandisaW Aug 08 '16 at 16:47
  • 11
    Another way to set the gesture center: Depress SHIFT, and hold it down as you press CTRL. Gesture will be centered on the mouse location at the time you pressed CTRL. – greeble31 Mar 13 '18 at 15:59
  • For this to work you also have to make sure that you've got "Settings -> General -> Send keyboard shortcuts to" set to "Emulator controls" – Caleb Jun 28 '19 at 13:58
31

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.

Multi-Touch

The emulator supports multi-touch input, as an experimental feature in r17, using a tethered Android device running the SdkControllerMultitouch application. The application contains an activity that monitors 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/

But this is still a workaround since we need a real device. My advice would be to test your app directly on a real device as it's more robust, and even more performant.

JSON C11
  • 11,272
  • 7
  • 78
  • 65
K_Anas
  • 31,226
  • 9
  • 68
  • 81
  • 15
    Dude people who ask this question don't have physical devices. If you already have a physical Android device, why would you still need the emulator for? – Pacerier Jul 01 '15 at 13:41
  • 1
    @Pacerier I have one physical device but I still need the emulator to test on multiple devices. – Emzor Dec 24 '15 at 22:09
  • 12
    Android SDK emulator: Double click + CTRL is what worked for me. Rest of the answers didn't – voghDev Mar 29 '16 at 06:52
  • 4
    I was able to get it to work on a Mac by holding down the Command key and then options for pinching were available with my mouse. – Michael Osofsky Feb 07 '17 at 19:51
27

I know it's late reply but this might save someones time.

Double-click and then hold down the second click and move the mouse up to zoom out or down to zoom in.

Hope this works!

ppreetikaa
  • 1,149
  • 2
  • 15
  • 22
18

On a Mac running the latest version of AndroidStudio and a vanilla Nexus 5 API 24 emulator all you have to do is keep cmd () pressed.

enter image description here

The drag points will appear. After that just left click and drag anywhere on the screen!

Radu
  • 2,076
  • 2
  • 20
  • 40
12

I know this is old but this might still help someone.

On mac:

To zoom in use double click (on track pad)

To zoom out use Command + Shift + click (on track pad)

Emzor
  • 1,380
  • 17
  • 28
11

OK, I was experimenting a bit, and on the bluestacks android emulator, I've figured it out.

It is Ctrl+Mouse wheel. Works for me, hope it helps you too.

ppreetikaa
  • 1,149
  • 2
  • 15
  • 22
Andy8583
  • 111
  • 1
  • 2
6

There has been some progress in this field with android tools release 17 : you can use a device to control the emulator : http://developer.android.com/sdk/tools-notes.html.

Otherwise, it looks like testing on real device is just better for this case (and in general its also much faster).

Snicolas
  • 37,840
  • 15
  • 114
  • 173
6

For mac: Use the ⌥ Option key and then use your mouse or trackpad to pinch/zoom. This is working on the android studio emulator.

You can find all the shortcuts in the extended controls menu, by pressing the three dots on the menu and then navigating to "help".

Blue
  • 22,608
  • 7
  • 62
  • 92
Marius Kohmann
  • 713
  • 1
  • 8
  • 11
4
  1. Click 3 points (like preferences on emulator)
  2. Settings
  3. set param "Send keyboard shortcuts to" from "Virtual device" to "Emulator controls" now gestures work perfect!
2

An Android Emulator doesn't support multi-touch you can't test it on emulators. Please use real-device for multitouch testing.

For recent developments in this regard read this - http://tools.android.com/tips/hardware-emulation

alchemist
  • 1,081
  • 12
  • 17
1

PinchZoom works on Multi-Touch.

If the device is supporting multi-touch then only your code will work else it wont work.

As the Android Emulators doesn't support multi-touch you can't test it on emulators.

Still new ADT has feature But I never tried this

MKJParekh
  • 34,073
  • 11
  • 87
  • 98
1
  1. CTRL + a click on left side of the view screen will zoom out.

  2. Double click on a location will zoom in.

  3. North and South -> Scroll wheel - up and down

  4. West-> CTRL+Scroll up at left side of the screen

  5. East-> CTRL+Scroll up at right side of the screen

Lachlan Goodhew-Cook
  • 1,101
  • 17
  • 31
siva
  • 11
  • 1
1

On macbook with Android studio Bumblebee, I have to hold control first which lets the drag pointer to appear on the screen. Then all I need to do is double tap, hold the second tap, and drag to zoom-in/out.

Harshal Pudale
  • 178
  • 1
  • 2
  • 7
0

As of March 1, 2016 for the Android Studio's emulator on Windows. The pinch key on the emulator is the Alt key. Hold down Alt and click and drag your mouse button.

The CTRL key might still work for you, but it doesn't work for me.

Kerat
  • 11
  • 4
-3

You can not able to test pinch zoom in Emulator. Please use Real device to test pinch zoom effect.

I have not try with youwave. May be you can able to test pinch in that environment. Not sur but just try with it.

Enjoy Coding....

Dhruvil Patel
  • 2,910
  • 2
  • 22
  • 39