Debugging a libgdx application from the terminal JDB

140 Views Asked by At

I have been working on a LibGDX game/application, and due to the use of Gradle was not really sure how to debug it.

I don't use an IDE and mostly debug with JDB but couldn't find anywhere how to do it.

The documentation is not very revealing either.

1

There are 1 best solutions below

0
On

The best way I have found is to run th program in debug mode with:

gradle desktop:debug

Gradle will then start listening to a socket and prompt it:

Listening for transport dt_socket at address: 5005

In a second terminal you need to launch jdb with the -attach flag followed by the socket:

jdb -attach 5005

From this point onward you can debug the program, as you would normally do with jdb.