Android, how to emulate gestures in AVD?

How can I simulate gesture wipes (e.g. left and right) on an AVD? Is it even possible? (In Android Developer's Guide - Emulator I can not find them ...

PS: I have "Touch Screen Support" set to "yes" in the settings of the Android 2.2 device, API level level 8

+6
source share
4 answers

Just click and hold and move the mouse to create the desired movement.

+4
source

I know this has been answered, but I replied to provide a very simple way to model sensory events for future search engines.

One easy way is blind copying!

Instead of reading the getevent output and computing it, then give sendevent that is really slow. Just blindly copy gestures from a real device with the same version of Android, then paste them blindly.

You can copy touch input in a real device with:

1- At the command line adb dd if=/dev/input/event2 of=/sdcard/left .

2- Make a gesture that you want to simulate (swipe).

3- This wall creates a file named (/sdcad/left) with data created by your real touch.

4- Move the file anywhere in your AVD, say (/sdcad/left) .

5- In the AVD adb shell, run dd if=/sdcard/left of=/dev/input/event2

Viola! A simulated touch event will occur.

NOTE. On my device, a file that has touch events /dev/input/event2 may differ from device to another, so you can use the trial version and the error first.

In short, if you record and play on the same device:

1- dd if=/dev/input/event2 of=/sdcard/left

2- Touch the real

3- dd if=/sdcard/left of=/dev/input/event2

4- Repeat step 3 as you need.

Greetings :)

+4
source

You can record the input events and play them on the emulator using the adeb shell and adb shel sendevent, it is a little difficult to understand, and you need to convert the hexadecimal values ​​of the getevent output file to decimal, but very useful.

+2
source

tl; dr: I think you can feel that it does not work when the problem is that it simply very slowly leads to user input processing on the Internet. If you communicate with him for 10 minutes, and he still does not work, then something is wrong - but give him 10 minutes.

Here is my experience so you can see how I came to this conclusion:

I never added a device to AVD Manager - Studio added it for me.

When I started the application (Hello World), it took quite a while - at first, nothing happened, so I clicked on “Android” at the bottom of the Studio window and found that it was registering what it was doing.

There were still numerous delays. After a minute or so, an emulator appeared, and he got a message about a lack of backup or something like that. After another minute, I saw that he said “Charging,” so I pressed and dragged, but nothing happened. I tried this a few more times, and finally he answered by changing “Charging” to “Swipe to unlock” (I think something like that). So I tried dragging a few times, but it didn't seem to register a drag. Finally, I noticed that the camera (software) button lights up when I iterate over it, so I clicked it, then I hit the camera (not sure if it was a drag or click on a small <in a white circle), and from there I could do something.

0
source

Source: https://habr.com/ru/post/894232/


All Articles