3

I am developing an Android app for my club at school and prefer to develop on my desktop computer back in my dorm. I often have to take my laptop elsewhere to collaborate with teammates, but still prefer to remote into my desktop as it is significantly faster than my laptop.

The problem with developing remotely is that I cannot easily test my app since my phone is plugged into my laptop and my desktop does not recognize it. I have tried to solve this using SSH, but have run into an error.

Running ssh -R 5037:localhost:5037 desktop from my laptop establishes an SSH connection, but attempting to start the ADB server on my desktop while the SSH tunnel is established throws error: protocol fault (couldn't read status): No error. I have tried following server different tutorials but haven't found anyone else having this issue.

These are the commands I have been using in this order:

adb kill-server (Desktop)

adb kill-server (Laptop)

adb devices (Laptop)

ssh -R 5037:localhost:5037 *desktop* (Laptop)

adb devices (Desktop)

The final adb devices on my desktop throws error: protocol fault (couldn't read status): No error

I am using Windows 10 on both laptop and desktop. Any help would be greatly appreciated!

o anyone finding this thread now, I figured it out and wanted to pass along the knowledge. Hopefully it works for you. I believe the root cause has something to do with localhost not translating properly into an IP, likely translating localhost into the IPv6 equivalent (::1) instead of the IPv4 (127.0.0.1) that adb seems to rely on.

This order worked for me: adb kill-server (executed on remote) adb kill-server (executed on local) adb devices (executed on local) ssh -R :5037:127.0.0.1:5037 (executed on local) adb devices (executed on remote through ssh tunnel)

Note the leading ":" in the ssh command, that tripped me up a few times.

Good Luck!

Glavon
  • 39
  • 1
  • 4
  • 2
    @AlexP. this is NOT a duplicate. Have you even read the question? The answer that you have linked has nothing to do with the problem in this question. This question is not about `adb connect`. And even more, this is a completely different scenario that involves working through an SSH tunnel, which is NOT at all mentioned in the linked answer. I am having the same problem now and it works with one PC and does not work with another, failing with this error. – noncom Feb 01 '19 at 09:56
  • 1
    @noncom I edited the original question with my solution, hopefully it helps you – Glavon Feb 12 '19 at 20:50

0 Answers0