0

I am trying to write some automation script for the Android emulator I am using. The emulator does provide simulation of pinches with keyboard and trackpad, but I would like to do it through the Android console, so I recorded the pinch with getevent, converted it to decimal and replay it with sendevent. I do observed the pinch but when it is done, the touch is not released and this mess up the simulations later on. I observe that if BTN_TOUCH UP event is send along with the pinch, it won't work. I cannot even do things like sh zoom-out.sh && sleep 1 && sh release.sh (assuming that I have the scripts to zoom out and releasing the touch in these 2 files). The only thing that works is through calling sh zoom-out.sh and then sh release.sh on a new line, which is wried to me.

6
  • you probably forgot BTN_TOUCH=UP (014a=0) make record of single tap only with 'getevent -lc10 /dev/input/event'
    – alecxs
    May 7, 2020 at 15:55
  • @alecxs Yes, I do am missing the button up event, but I don't know why I cannot record that. My touch screen events are in event5 and when I getevent -lc10 /dev/input/event I see the button up event while in dev/input/event5, there isn't. May 8, 2020 at 21:30
  • no need to record when you know whats missing
    – alecxs
    May 8, 2020 at 21:46
  • @alecxs That is right but I am new to Android and I see no documentation about sendevent, it doesn't even come with a help. Can you please point me to some resourses. I tried to resolve the macros with getevent -lp /dev/input/event5 and I find KEY as 1, BTN_TOUCH as 257 or 258 depending on it starts at 0 or 1. However that doesn't help. May 8, 2020 at 22:24
  • i.stack.imgur.com/SEeJ3.png
    – alecxs
    May 8, 2020 at 22:53

0

You must log in to answer this question.

Browse other questions tagged .