0

I'm developing an app that will only be used inside the AVD. My objective is automate some tasks. Sometimes, the "back button" needs to be pressed. I know that I can do it using the adb shell. However, I would like make it from my app code. I've tryed to command below, but I'm getting an "Permission denied" error.

Runtime.getRuntime().exec("adb shell input keyevent 4");

Do you have any idea how I can do it or give the necessary permissions?

Humba
  • 128
  • 1
  • 10

1 Answers1

0

This thread might help you sorting issues. Because as per my perspective you need root permission for that to execute commands or you can give it a try using processbuilder method.