godot: `print()` is no longer sent to Output panel when running project on Android due to debugger connection not working

Godot version

4.2 dev f5696c311cdb09e0a34fa4ba7ef5d2524c515b89

System information

Android

Issue description

When running an Android application with “remote debug” ticked, Godot would always output print and error messages to the log in the Godot IDE.

We use this extensively in XR where alongside the “verbose” tickbox, we add a lot of extra information through print_verbose. Even without that a standard Android project would atleast output the standard print lines (such as the “Godot Engine v4.1.1stable…” line).

So for instance running a simple XR project in Godot 4.1.1 stable with verbose enabled and remote debug enabled gives us: image

Doing the same in master: image

No more log. Same issue applies to normal Android. I have only tested this with gradle builds.

Steps to reproduce

Take a Godot project that can run on Android.

Enable remote debug

Run project on an Android device.

Minimal reproduction project

I think any simple project will do, but I used this for testing: https://github.com/GodotVR/godot-xr-template

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (4 by maintainers)

Most upvoted comments

I’m losing my mind to this issue. This is still a problem in 4.3. Restarting my computer works in order to fix this, but only for a short while. It’s getting excruciating at this point, I wonder if there’s any workaround before I actually go insane.

I am on 4.2 stable and the problem still exists, I am using gradle build and have turned on “Deploy With Remote Debug” already.

I have this same issue on 4.2.1. I notice when I start up the editor that it says that there is a failure to bind to port 6007.

  Cannot listen on port 6007, trying 6008 instead.
  Cannot listen on port 6008, trying 6009 instead.
  Cannot listen on port 6009, trying 6010 instead.

In the android export code (EditorExportPlatformAndroid::run) the port retrieved through:

int dbg_port = EDITOR_GET("network/debug/remote_port");

This doesn’t account for retries if the editor fails to bind to 6007.

Workaround

Go to Editor Settings -> Network -> Debug and change Remote Port to the actual debug port. Before closing the editor switch it back to 6007.

Any one can explain what would the ‘actual debug port’ be?

The actual debug port is the last port last port it attempts to connect to, so in my example log the actual debug port would be 6010.

Oh ok. I’m doing this on mac. Any idea where I can check for the last port it attempts to connect?