ADB commands not executing through Java program
I've searched through google and on this site to similar questions, but
none of their answers yielded any results for me.
I am currently creating a small tool to help me test some Android
applications. I want to be able to load APK(s), clear app data, etc (with
a GUI!), which are mostly 1-line adb commands or small shell scripts. I
can use the commands and shell scripts via the terminal just fine,
however, when I start using the commands in my Java program, I get the
following error:
java.io.IOException: Cannot run program "adb": java.io.IOException:
error=2, No such file or directory
from this line of code:
Runtime.getRuntime().run.exec("adb shell pm clear " +
selectedApp.getPackage());
I have a co-worker who is writing something similar, and uses this exact
line in his code successfully.
A few things to note:
I have already installed the 32bit lib.
I am not even sure that using this .exec() method is the way to go.
Your help is greatly appreciated! I'd like to be done with this by the end
of the weekend so I can use it at work on Monday.
Thanks, Chryis
No comments:
Post a Comment