Closed Zero3K closed 7 years ago
Since adb
can be used over TCP, it should in theory be possible. Unfortunately, this does not work.
First, connect your device to wifi, and get its IP:
adb shell netcfg
or
adb shell ifconfig
Then, switch its adb server to listen to port 5555:
adb tcpip 5555
Then, connect to it:
adb connect 5555
Unplug the device, you should be able to use a shell:
adb shell
Unfortunately, while adb forward
works, adb reverse
fails:
$ adb reverse tcp:31416 tcp:31416
error: more than one device/emulator
Even if this is the only device shown in adb devices
, and all other adb
commands work as expected.
I tested with the very last adb
(1.0.39).
Oh, here's something that should get it to work:
http://stackoverflow.com/questions/35269473/adb-error-more-than-one-device-android
@Zero3K This is not the same problem. Here, adb device
outputs exacly one device, and all adb
commands work except adb reverse
.
I'll try it out when my tablet is charged some more.
I can confirm that it doesn't work. Maybe its source could be modified to allow more than one device.
Maybe its source could be modified to allow more than one device.
What do you mean?
Anyway, in that case, there is exactly one device, it's probably a bug in adb for the reverse
command.
Could it be fixed?
I have no fix for this. If you do, please suggest.
A bug report exists: https://issuetracker.google.com/issues/37066218
Unfortunately, the problem occurs on the device side, so when it will be fixed, it will require to upgrade the device.
I am closing this issue since it is being taken care of by someone else.
Hey, it seems this patch has been merged into Pi. adb reverse
works successfully on my machine now.
When I try to ./gnirehtet run
: the device successfully connects; I can see on my device that it's connected to the VPN; but no traffic is passed.
I can confirm that adb reverse
is actually working: I tested with a file server on 31416 and I'm able to connect to it on localhost:31416
on my phone.
Output:
❯ ./gnirehtet run
2019-09-02 08:21:37.866 I Gnirehtet: Checking gnirehtet client...
2019-09-02 08:21:37.866 I Gnirehtet: Starting relay server...
2019-09-02 08:21:37.959 I Relay: Relay server started
2019-09-02 08:21:38.003 I Gnirehtet: Starting client...
Broadcasting: Intent { act=com.genymobile.gnirehtet.START flg=0x400000 cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver }
Broadcast completed: result=0
Okay: so I am able to reliably get it working by:
./gnirehtet run
adb reverse --list
will be empty)../gnirehtet tunnel
./gnirehtet start
again.I'm not sure if the reverse tunnel breaks because of a adb bug, or bug in the code.
However, starting a file server instead of the relay after the tunnel does not cause it to break; so I'm assuming it's a bug in the code.
Breaking it down further, if I:
./gnirehtet tunnel
./gnirehtet relay
./gnirehtet start
<-- tunnel breaks here./gnirehtet tunnel
./gnirehtet start
<-- it begins to work here
Is it possible to do so or not?