DeviceManagerADB should support TCP/IP

RESOLVED FIXED in mozilla13

Status

Testing
General
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: wlach, Assigned: wlach)

Tracking

Trunk
mozilla13
All
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

You can pass in a host, which implies that this works, but it doesn't.

Christian Holler provided a patch.
Created attachment 599038 [details] [diff] [review]
Make DeviceManagerADB support adb over tcp/ip

choller's patch
Assignee: nobody → wlachance
Hi Christian, this looks like it *should* work, but it doesn't for me. I was following the instructions here:

http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp
(In reply to William Lachance (:wlach) from comment #2)
> Hi Christian, this looks like it *should* work, but it doesn't for me. I was
> following the instructions here:
> 
> http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-
> adb-over-tcp

I don't fully understand, it should work out of the box (by just instantiating DeviceManagerADB with a host != None), and it did both on my box and the tegrapool host.

Or are you trying to setup your tablet so you can test it? What errors are you getting?
(In reply to Christian Holler (:decoder) from comment #3)
> (In reply to William Lachance (:wlach) from comment #2)
> > Hi Christian, this looks like it *should* work, but it doesn't for me. I was
> > following the instructions here:
> > 
> > http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-
> > adb-over-tcp
> 
> I don't fully understand, it should work out of the box (by just
> instantiating DeviceManagerADB with a host != None), and it did both on my
> box and the tegrapool host.
> 
> Or are you trying to setup your tablet so you can test it? What errors are
> you getting?

Yeah, I'm testing this on the phone. The python code doesn't work. When I try to do similar things on the command line, here's what I see:

wlach@eideticker:~/src/mozilla-central/build/mobile$ adb connect 192.168.1.8:5555
unable to connect to 192.168.1.8:5555:5555
wlach@eideticker:~/src/mozilla-central/build/mobile$ adb connect 192.168.1.8
unable to connect to 192.168.1.8:5555

(this is after doing this dance on the device:

setprop service.adb.tcp.port 5555
stop adbd
start adbd

)

So I don't think it's something that you're doing, but I wonder why this isn't working for me.

--

Also, looking at the code itself, do you really want to put the call to 'self.connectRemoteADB()' inside the try block? Seems to me like we should just bail with an exception if that doesn't work rather than continuing on pretending that things are ok.
(In reply to William Lachance (:wlach) from comment #4)

> Yeah, I'm testing this on the phone. The python code doesn't work. When I
> try to do similar things on the command line, here's what I see:
> 
> wlach@eideticker:~/src/mozilla-central/build/mobile$ adb connect
> 192.168.1.8:5555
> unable to connect to 192.168.1.8:5555:5555
> wlach@eideticker:~/src/mozilla-central/build/mobile$ adb connect 192.168.1.8
> unable to connect to 192.168.1.8:5555
> 
> (this is after doing this dance on the device:
> 
> setprop service.adb.tcp.port 5555
> stop adbd
> start adbd
> 
> )
> 

Oh now I understand :) The problem is, I never set this up for my device, because I'm using a device from the Tegra Pool now and they have TCP/IP enabled by default.

Have you tried using "adb tcpip 5555" over USB? Help says: "restarts the adbd daemon listening on TCP on the specified port". You could also ask jmaher how it's done in the tegra pool. The Python code just expects that if you specify a host, then the host is already setup properly.

> Also, looking at the code itself, do you really want to put the call to
> 'self.connectRemoteADB()' inside the try block? Seems to me like we should
> just bail with an exception if that doesn't work rather than continuing on
> pretending that things are ok.

I fully agree with you. However, I was told that instantiating DeviceManagerADB must never fail (even if adb isn't installed), because some of testing code in m-c always instantiates a DeviceManagerADB, regardless if it's supposed to be used or not. If that code never passes a host, then we could make the connect method failing fatal.
Comment on attachment 599038 [details] [diff] [review]
Make DeviceManagerADB support adb over tcp/ip

Ok, I'm satisfied that this patch will work.
Attachment #599038 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/09e64089bb07
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.