有没有办法在Android模拟器上测试多点触控?

发布于 2024-09-01 00:53:33 字数 84 浏览 11 评论 0 原文

可以在Android模拟器上测试多点触摸事件吗?或者有什么方法可以在没有实际设备的情况下进行测试?我正在使用 2.0 sdk,想用两根手指测试放大/缩小。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(11

习惯成性 2024-09-08 00:53:33

我终于发现了如何在 Android Studio 3.2 的 Android 模拟器上进行捏缩放。这很难找到,但希望对某人有所帮助。

  • 将鼠标移动到您想要捏缩放中心的位置。 (不要按鼠标按钮)
  • 按 SHIFT(不要按鼠标按钮)
  • 按 Command(不要按鼠标按钮)
  • 您应该会在鼠标下方看到一个圆形目标(您还没有按下鼠标按钮,是吗? )
  • 将鼠标从第一个位置移到您想要第二个“手指”的位置,
  • 现在您可以按下/拖动鼠标来进行捏合/缩放,

这很容易 - 或者不容易。

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.

平生欢 2024-09-08 00:53:33

更新:

是的,现在有(不是针对 2.x Android,而是针对最新的)。

如果人们仍在使用此功能进行搜索,如果您正在使用
Android Studio 的默认模拟器,对于 mac 用户,您可以持有
命令按钮
,对于 windows/linux 我相信它是 alt 按钮,而
用鼠标左键单击 – HendraWD

对于 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).

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.

楠木可依 2024-09-08 00:53:33

现在可以使用新版本的模拟器了。

要使用多点触控功能,请按住键盘上的 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

鞋纸虽美,但不合脚ㄋ〞 2024-09-08 00:53:33

自 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.

断舍离 2024-09-08 00:53:33

很高兴知道我们在 Android 中也有了多点触控模拟器,因此借此机会让 Android 用户知道谁还没有。

您可以通过对当前的开发工具进行以下更新来测试它:

  1. 将我的 Android Studio 从 2.0 预览版 4 更新到 2.0 预览版 5。
  2. 将我的 Android SDK 工具更新到 25.0.2 rc3
  3. 将我的 Android 6.0 Google API Intel x86 Atom_64 系统映像更新为修订版12
  4. 项目级别对类路径“com.android.tools.build:gradle:2.0.0-alpha5”的依赖

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:

  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.

捎一片雪花 2024-09-08 00:53:33

不,

据我所知,模拟器仍然没有任何多点触控检测驱动程序(在 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).

别忘他 2024-09-08 00:53:33

在 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)".

何止钟意 2024-09-08 00:53:33

有些答案已经过时,或者可能取决于模拟器版本,所以就我而言(在 Windows 上运行的模拟器),您可以这样做:

  • 按 Shift
  • 按 Ctrl
  • 使用鼠标左键放大/缩小或旋转

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
她说她爱他 2024-09-08 00:53:33

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.

追我者格杀勿论 2024-09-08 00:53:33

适用于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 :)

残疾 2024-09-08 00:53:33

对于我来说,在 ubuntu 上双击鼠标是有效的。第一次左键单击 + 快速左键单击并按住,同时移动鼠标。

输入图片此处描述

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

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文