DeviceFarmer / stf

Control and manage Android devices from your browser.
https://devicefarmer.github.io
Other
3.05k stars 452 forks source link

`adb reverse` doesn't work #44

Open AdbReverse opened 4 years ago

AdbReverse commented 4 years ago

What is the issue or idea you have? adb reverse don't work over STF

Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row. It doesn't work on both of my devices

Please provide the steps to reproduce the issue. On Development PC: adb connect : adb reverse tcp:12345 tcp:12345 nc -lp 12345 On mobile device toybox nc 127.0.0.1 12345 toybox nc localhost 12345 both don't work.

What is the expected behavior? It should connect to the nc

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.80. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

koral-- commented 4 years ago

Does it work when you configure it via STF UI?

AdbReverse commented 4 years ago

Do you mean the "port forward" feature? It doesn't work for me either.

Those are the logs for the port forward: (I replaced sensitive information with xxxx)

2020-07-20T15:51:10.489Z INF/device:plugins:forward 3954805 [xxxxxxxxxx] Creating reverse port forward "AAAAAAAAAAAAAA" from ":1234" to "1.1.1.38:1234"
2020-07-20T15:51:10.489Z INF/device:plugins:forward 3954805 [xxxxxxxxxx] Connecting to reverse port forwarding service
2020-07-20T15:51:10.497Z INF/device:plugins:forward 3954805 [xxxxxxxxxx] Forward shell says: "Forwarding port 1234"

The log is confusing because it looks like everything works fine. but this is not true.

AdbReverse commented 4 years ago

I am trying to provide internet connection from USB through Gnirehtet - https://github.com/Genymobile/gnirehtet Gnirehtet required adb reverse to work in order to provide it.

denis99999 commented 4 years ago

@AdbReverse ,

Look at the #1212 issue in which an example is done for a correct use of adb connect and adb reverse commands!

wdjcodes commented 3 years ago

I had a similar issue. I have openstf (a long with an adb server) running in docker containers on a server. When I do adb reverse it reverses the phone connection into the adb container. I resolved this by putting iptables rules in the adb container to forward the connection back to the intended host

douniwan5788 commented 2 years ago

@denis99999 adb reverse never worked https://github.com/devicefarmer/adbkit#devicereverseremote-local

It's important to note that if you are connected to a remote ADB server, the reverse will be created on that host.