Search code examples
javaandroidkeykeypresssimulate

Simulate key press?


I am looking for a method that allows me to press freely on the Android screen. Simply put, it would emulate what a person can do to move on the Android device

I want him to press the buttons of this game. I want to make a bot. enter image description here


Solution

  • To get the control of the keystrokes from a background app you need to be root. Instead of that, you can use monkeyrunner to make scripts using Python. Another option is to use direct commands in ADB, as stated in this answer. Every option needs to be connected to a computer via USB cable.