I want to implement a click on my app programmatically. For doing that I thought of implementing the adb command for touch. The command is:
adb shell input tap x y
This command works on my adb shell, but i cant figure out a way of implementing it programmatically.
I tried the below piece of code:
private void runShellCommand(String command) throws Exception {
Process process = Runtime.getRuntime().exec(command);
process.waitFor();
}
But I am getting this error in the debugger:
java.io.IOException: Cannot run program "adb": error=13, Permission denied
Could someone please help me with this!
PS: Even if you know other methods of programmatically touching the screen with the help of providing x and y coordinates please do help!