ADB over TCP IP

230 views
Skip to first unread message

divya

unread,
Jan 21, 2009, 9:35:04 AM1/21/09
to android-porting, divya....@sasken.com
Hi,

I have succefully got the android up and running on OMAP 3430. But
now I want to use adb tool to push applications on to the device and
also for debugging.

I have assigned my OMAP 3430 board an IP. How can now connect to
the board using a windows machine(host).

After searching for this information I have got a way from a linux
machine using the below commands:

# Killall –a adb
# export ADBHOST=<target ip address>
# adb shell

Is this right for linux host? Do we have the same for a windows
machine?..

Any information is welcome....

Regards,
Divya

David Turner

unread,
Jan 21, 2009, 10:04:16 AM1/21/09
to android...@googlegroups.com, divya....@sasken.com
This is not currently possibe.

First of all, you need to understand that there are 3 components to ADB:

- the 'adbd' daemon that runs on the device
- the 'adb server' that runs as a background process on the host development machine
- the 'adb client', which can be either the adb executable or DDMS, which communicate with the server

the 'adbd' daemon that runs on a real device only listens to the USB communication channel, and it simply is not possible to make it listen to an IP address. consequently, the 'adb server' must run on a host machine that is connected to the device through USB

I believe these limitations are here for security reasons. You certainly don't want anyone on the network be able to access the adbd daemon on your device by default.

ADBHOST is a relic of ancient code that has been removed for security reasons. Its handling is probably broken and will not work as you expect it to, and the best it could do is connect an adb client running on machine A to an adb server running on machine B; which is not exactly what you're looking for (and if the latter interests you, you probably should better use SSH port forwarding to do that securely).

divya

unread,
Jan 21, 2009, 10:13:40 AM1/21/09
to android-porting, divya....@sasken.com
Hi David,

Thanks for this valuable information.

So you mean it not at all possible to run an adb using IP
address. So if I am to use the adb from a windows system I need to
install the android_usb_driver for windows and then connect my OMAP
3430 SDP board using an USB cable to the windows system. Then give the
path of the driver where it installed. After that what am I suppose to
do...

And is there any driver for the linux machine?

Could you help me more in this context?....

Regards,
Divya
> > Divya- Hide quoted text -
>
> - Show quoted text -

Mike Lockwood

unread,
Jan 21, 2009, 10:15:06 AM1/21/09
to android...@googlegroups.com, divya....@sasken.com
It sounds like Divya wants to do this to develop on an OMAP
development board, not a real phone. In that case, the security issue
probably is not important.

Wouldn't it be possible to modify adbd to listen for connections on
external ports and connect to it from a PC over ethernet? I thought I
heard someone had gotten that working in the x86 port.

Mike
--
Mike Lockwood
Google android team

divya

unread,
Jan 21, 2009, 10:22:39 AM1/21/09
to android-porting
Hi Mike,

Right now my intention is to develop it on an OMAP board. But would
like to knw the security angle too.. Just incase, if I need to develop
on a real device...

I checked the same with the android-x86 as you had suggested ,but was
not successfully in finding anything useful...

Regards,
Divya
> > On Wed, Jan 21, 2009 at 6:35 AM, divya <pdiv...@gmail.com> wrote:
>
> >> Hi,
>
> >>   I have succefully got the android up and running on OMAP 3430. But
> >> now I want to use adb tool to push applications on to the device and
> >> also for debugging.
>
> >>   I have assigned my OMAP 3430 board an IP. How can now connect to
> >> the board using a windows machine(host).
>
> >>   After searching for this information I have got a way from a linux
> >> machine using the below commands:
>
> >>   # Killall –a adb
> >> # export ADBHOST=<target ip address>
> >> # adb shell
>
> >> Is this right for linux host? Do we have the same for a windows
> >> machine?..
>
> >> Any information is welcome....
>
> >> Regards,
> >> Divya
>
> --
> Mike Lockwood
> Google android team- Hide quoted text -

David Turner

unread,
Jan 21, 2009, 10:59:20 AM1/21/09
to android...@googlegroups.com, divya....@sasken.com
Looking at the sources, it might be possible. If the ro.secure property is *not* set (and I believe that it is always set for typical device builds),
then the adbd daemon will listen for requests on localhost port 5037. The problem is I'm really unsure that everything is going to work fine if an external client ever tries to access it (which would at a minimum require some amount port forwarding currently). The adb client expects the server to do some sort of transport switching/tunneling and it's likely that some features will not work properly due to this.

However, I agree it is desirable for core platform development to allow direct connection to the device. This may need some work though but I'll keep in mind when working on it in the near future.

Sean McNeil

unread,
Jan 21, 2009, 9:47:30 PM1/21/09
to android...@googlegroups.com, divya....@sasken.com
Huh? I do this all the time. I setup ethernet over USB and then connect
to the phone with:

ADBHOST=192.168.0.202 adb kill-server
ADBHOST=192.168.0.202 adb command

I don't know what you mean that it isn't possible. I guess I'm doing the
impossible, then. ;)

Brian Swetland

unread,
Jan 22, 2009, 12:51:55 AM1/22/09
to android...@googlegroups.com, divya....@sasken.com

I think David is confusing the transport-over-IP feature which adbd on
the device will fail back to if it can't open the usb device driver with
the local adb control socket on the device which was disabled to avoid
possible security issues (potentially giving untrusted apps debugging
access to the world via adb).

The IP transport stuff is a little cranky at times, but obviously does
work (and I've used it during bringup on boards where USB was not
working but an ethernet interface was).

[Sean McNeil <seanm...@gmail.com>]

divya

unread,
Jan 22, 2009, 6:29:04 AM1/22/09
to android-porting
Hi,

I was able to use adb using the linux machine. Now my requirement
is the debugging using the windows. I installed the android usb for
windows and have assigned the VID and PID as mentioned in adb.c. As
soon as I connect the device it shows New Hardware Found. I followed
the steps mentioned and manually provided the path where I had
unzipped the android_usb_windows.zip. But I am getting "the hardware
cannot be installed because wizard cannot find the necessary
software". Can any 1 help me with this.

The VID and PID specified in adb.c is 18D1 and D00D.
But there is different options given in .inf file...
What do I change more..


Working on OMAP Board 3430.

Regards,
Divya

On Jan 22, 10:51 am, Brian Swetland <swetl...@google.com> wrote:
> I think David is confusing the transport-over-IP feature which adbd on
> the device will fail back to if it can't open the usb device driver with
> the localadbcontrol socket on the device which was disabled to avoid
> possible security issues (potentially giving untrusted apps debugging
> access to the world viaadb).
>
> The IP transport stuff is a little cranky at times, but obviously does
> work (and I've used it during bringup on boards where USB was not
> working but an ethernet interface was).
>
> [Sean McNeil <seanmcne...@gmail.com>]
>
>
>
>
>
> > Huh? I do this all the time. I setup ethernetoverUSB and then connect
> > to the phone with:
>
> > ADBHOST=192.168.0.202adbkill-server
> > ADBHOST=192.168.0.202adbcommand
>
> > I don't know what you mean that it isn't possible. I guess I'm doing the
> > impossible, then. ;)
>
> > David Turner wrote:
> > > This is not currently possibe.
>
> > > First of all, you need to understand that there are 3 components toADB:
>
> > > - the 'adbd' daemon that runs on the device
> > > - the 'adbserver' that runs as a background process on the host
> > > development machine
> > > - the 'adbclient', which can be either theadbexecutable or DDMS,
> > > which communicate with the server
>
> > > the 'adbd' daemon that runs on a real device only listens to the USB
> > > communication channel, and it simply is not possible to make it listen
> > > to an IP address. consequently, the 'adbserver' must run on a host
> > > machine that is connected to the device through USB
>
> > > I believe these limitations are here for security reasons. You
> > > certainly don't want anyone on the network be able to access the adbd
> > > daemon on your device by default.
>
> > > ADBHOST is a relic of ancient code that has been removed for security
> > > reasons. Its handling is probably broken and will not work as you
> > > expect it to, and the best it could do is connect anadbclient
> > > running on machine A to anadbserver running on machine B; which is
> > > not exactly what you're looking for (and if the latter interests you,
> > > you probably should better use SSH port forwarding to do that securely).- Hide quoted text -

David Turner

unread,
Jan 22, 2009, 5:00:24 PM1/22/09
to android...@googlegroups.com, divya....@sasken.com
My bad, Brian's right, to activate this, you need however to be sure that:

- the ro.secure property is *not* set when the adbd daemon is launched
- /dev/android_adb or /dev/android do *not* exist

I naively assumed that you had the adb device on your system.
Reply all
Reply to author
Forward
0 new messages