Is it possible to simulate a click on the screen in Android?

TyrionLannister picture TyrionLannister · May 20, 2013 · Viewed 14.5k times · Source

Is it possible to simulate a "click" (touch screen) by coordinates or on a view element?

Answer

suv picture suv · Nov 29, 2017

It is possible to simulate touch events on android screen. If you have the coordinates of the view then you can generate touch events by using adb shell commands. For e.g-

adb shell input tap x y

where x and y are your coordinates. You can run this command from terminal. If you want to run the command from android code then use "/system/bin/ input tap x y" and run this by using Runtime.getRuntime() method. For details please reply, happy to help! :)