有没有办法在Android模拟器上测试多点触控?
可以在Android模拟器上测试多点触摸事件吗?或者有什么方法可以在没有实际设备的情况下进行测试?我正在使用 2.0 sdk,想用两根手指测试放大/缩小。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
可以在Android模拟器上测试多点触摸事件吗?或者有什么方法可以在没有实际设备的情况下进行测试?我正在使用 2.0 sdk,想用两根手指测试放大/缩小。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(11)
我终于发现了如何在 Android Studio 3.2 的 Android 模拟器上进行捏缩放。这很难找到,但希望对某人有所帮助。
这很容易 - 或者不容易。
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.
That was easy - or not.
更新:
是的,现在有(不是针对 2.x Android,而是针对最新的)。
对于 Linux,它是 Ctrl + 左键单击(但是,我不知道在 Windows 上是否相同,所以 HendraWD 可能是正确的)
加上您可以做的另一件事(使用 Android 4.0) +) 是将触摸事件通过一台设备传送到模拟器中。如果您只有一台设备,但想在其他版本/尺寸的 Android 上测试相同的触摸事件,这会很有帮助。 参阅 http://tools.android.com/tips/hardware-emulation)
(请 无论如何,这些只是解决方法,如果多点触控对您的应用程序很重要,我仍然建议您带着笔记本电脑前往 Android 开发者用户组,寻求帮助来现场测试您的应用程序。您的开发人员同事对此会非常有帮助。
在我的小组中,我们一直共用手机(特别是因为我们大多数人并不拥有所有不同的 Android 手机)。如果您所在地区没有 Android 用户组,假设您居住在足够大的大都市区,请考虑自己创建一个这样的组。您很可能不是唯一需要这方面帮助的人。
UPDATE:
Yes, now there is (not for the 2.x Android, but the latest ones).
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.
现在可以使用新版本的模拟器了。
要使用多点触控功能,请按住键盘上的 Alt 键,然后右键单击鼠标以使参考点居中,或者单击并单击拖动鼠标左键进行缩放。
http://tools.android.com/tips/hardware-emulation
http://android-developers.blogspot.nl/2016/02/android -studio-20-beta.html
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
自 ADT 17 起,可以使用物理 Android 4.0 设备向模拟器发送多点触控手势。 请在此处查看 Android 的说明。
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.
很高兴知道我们在 Android 中也有了多点触控模拟器,因此借此机会让 Android 用户知道谁还没有。
您可以通过对当前的开发工具进行以下更新来测试它:
PS: 请不要立即更新,因为它包含我发现的一个错误。这是一个严重的错误。它干扰了我们的开发常规。您可能想在此处查看我的问题。
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:
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.
不,
据我所知,模拟器仍然没有任何多点触控检测驱动程序(在 https://android.googlesource 中查看了代码.com)。
No.
AFAIK, The emulator still does not have any multi-touch detection driver (saw the code at https://android.googlesource.com).
在 WINDOWS 上的默认 Android Studio 模拟器中:
1- 使用 Ctrl 键显示多点触控手柄并按住它。
2- 按左键单击并移动鼠标以执行操作。
注意:如果按下 Ctrl 键但手柄未出现,则:
打开模拟器设置>设置选项卡>将“发送键盘快捷键至”设置为“模拟器控件(默认)”。
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)".
有些答案已经过时,或者可能取决于模拟器版本,所以就我而言(在 Windows 上运行的模拟器),您可以这样做:
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:
Xamarin Android 播放器启用了多点触控选项。
来源: https://developer.xamarin.com/guides/android/ getting_started/installation/android-player/
通过按住 Alt/Option 键并单击屏幕,可以模拟两指多点触控输入。
要模拟捏缩放,请按住 Alt/Option 按钮并向屏幕中心拖动(用于缩小)或远离屏幕中心(用于放大)。
要模拟两根手指拖动,请按住 Alt/Option + Shift,同时在屏幕上单击并拖动。
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.
适用于Android 4.2.1的Mac用户;
按 Shift+Command,应该会出现一个可见的圆形图标。之后你就可以玩它了:)
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 :)
对于我来说,在 ubuntu 上双击鼠标是有效的。第一次左键单击 + 快速左键单击并按住,同时移动鼠标。
For me on ubuntu double mouse click was working. First left click + fast left click and hold while moving mouse.