user961171
user961171

Reputation: 1

Execute 'adb' from an APK

Planning to execute adb to do some operation from a TestActivity.Java and try to execute the TestActivity.apk.

File wd = new File("/Android/android-sdk-windows/tools/");
Process proc = Runtime.getRuntime().exec(
                      "adb shell monkey -p com.sample.cts -v 50", null, wd);
proc.waitFor();

Getting the following error:

java.io.IOException: Error running exec(). Command: [adb, shell, monkey, -p, com.sample.cts, -v, 5000] Working Directory: null Environment: null

Can you please help me on this?

Upvotes: 0

Views: 836

Answers (2)

NandaKumar
NandaKumar

Reputation: 173

This is an error that android sdk is not properly attach to your eclipse Go to preference -> click on android -> see whether all sdk are files displaying -> if it not display go for solution that i given below

This thing properly happen when antiviruses remove some sdk files in your sdk folder

Solution: Once again download the sdk file from beginning or otherwise get the sdk package from others and put it

Upvotes: 0

Knickedi
Knickedi

Reputation: 8787

adb stands for Android Debug Bridge and it's a local helper program for developers. I doubt that this program is actually located on the device itself.

Upvotes: 1

Related Questions