Is it possible to execute adb commands through my android app?

You can do it with this:

Process process = Runtime.getRuntime().exec("your command");
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));

Don’t forget to surround it with a try and catch statement.

Edit:

@Phix is right, ProcessBuilder would be better to use.

Leave a Comment