0

I've been trying to setup ADB remote debugging for Qt. Scenario:

  • Remote development server with QT
  • Local laptop with connected phone

Solution: I tunnel all the traffic on port 5037 (default adb port) through a Remote Port Forwarding SSH session. Works Fine. The commands I execute:

# Kill old adb server.
devhost$ adb kill-server 

# Activate adb server on client
laptop$ adb start-server

# Start ssh tunnel. Hide/minimize this window not to close it by accident
laptop$ ssh -XC -R 5037:localhost:5037 <your devhost machine>

QT on dev. server detects the mobile, attempts to the deploy.

The app gets deployed. The result FEELS GOOD. ~~With dev server in another country. It's optic fiber all the way from server right to my desk... But not so fast... When all of the sudden QT shouts about being unable to connect with localhost:5039

5039? What is it needed for? I tried tunelling 5039 but I'm basically in a blind-spot. The error is gone but the app is stuck at waiting for debugger and no further messages from QT no errors.

Nothing. It just hangs indefinitely.

On the mobile there's the standard waiting for debugger msg at the bottom. (Note: the app got deployed by qt and launched).

Ideas?

The only informative message within log is:

W ActivityThread: Application org.qtproject.APPNAME is waiting for the debugger on port 8100...

8100? now what is that? Is that supposed to be taken care of by ADB/QT or what

I can see all the logcat events on dev-server while the app on mobile 'keeps waiting' ..browser entire logcat log. the only sensible message regarding debugging is that the app keeps waiting on and on.

Local debugging of same app through USB works FINE.

The remote server is able to compile deplay and launch the app on mobile phone, however dubugging is an exercise in futility due to the described behaviour.

I have noticed that during debugging attempts, adb on local laptop keeps opening new ports and listening on these. what the heck is going on here? enter image description here

On the contrary, when debugging over USB, 5037 is the only port used everything works and adb does not go into the new-port-creation frenzy.

Vega4
  • 969
  • 1
  • 11
  • 25
  • Have you tried to give the permission `android.permission.SET_DEBUG_APP` like suggested here: https://stackoverflow.com/a/4375505 – Bruno Bieri Feb 02 '21 at 12:12
  • Tried. The entry was not there, but the local debug worked fine. Added the entry, did not help for remote debugging. The app got deployed over 5037, after - QT complained about port 5039 not being open. and that was it. Tried tunneling 5039. no complaint but did not help as well. It keeps hanging indefinitely at :Waiting for debugger. Random port gets open in adb.exe as ilustrated above. The port number seems to be random I have no way of guessing that beforehand, also does not help during local debug (or maybe it does but quickly goes away I have no idea) – Vega4 Feb 03 '21 at 07:57
  • Have you seen that one in the QT forum: https://forum.qt.io/topic/90241/android-debugging-fails-connecting-to-remote-server-failed-remote-communication-error-target-disconnected-no-error/3? – Bruno Bieri Feb 03 '21 at 10:03

0 Answers0