Thursday, March 3, 2011

[android-developers] Use AndroidDebugBridge and ddmlib in my own desktop application

Hello all!

I am trying to use AndroidDebugBridge in my desktop application but I fail.
Namely, although I am able to get a list of devices currently attached to my system, I am not able get a list of Clients (the running applications and especially my running application).
Here is a minimal example:

AndroidDebugBridge.init(false);
AndroidDebugBridge adb = AndroidDebugBridge.createBridge("PATH_TO_adb", true);
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
}
System.out.println(adb.getDevices().length);
System.out.println(adb.getDevices()[0].getClients().length);
adb.terminate();

Here is the example output:
1
0
which means that I do get a device, but I don't get any clients.
Can you help me what I am doing wrong?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment