Thursday, March 3, 2011

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

does DDMS show those clients? ddms/lib will only show clients that are
debuggable (or all of them on the emulator).

Also doing a sleep and getting the device list is not the way to go.
You should register listener on the bridge to be notified as devices
get discovered/disconnected and clients are started/killed.

Xav

On Thu, Mar 3, 2011 at 12:07 AM, Panayotis Katsaloulis
<panayotis@panayotis.com> wrote:
> 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
>

--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

--
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