Using remote debug on Android (2.1.4-beta)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DrMoriarty
:warning: Old Version Published before Godot 3 was released.

I’m trying to debug and profile my game on android device. I have these deploy settings:

The Editor - Network settings:

The Editor - File Server settings:

When I try to start the application on the device (green android button) I have this crash:

08-19 21:20:11.928: I/godot(32492): Remote Debugger: Connection failed with status: '3', retrying in 1 sec.
08-19 21:20:12.928: I/godot(32492): Remote Debugger: Connection failed with status: '3', retrying in 1 sec.
08-19 21:20:13.929: I/godot(32492): Remote Debugger: Connection failed with status: '3', retrying in 1 sec.
08-19 21:20:13.929: I/godot(32492): Remote Debugger: Unable to connect
08-19 21:20:13.931: E/godot(32492): Could not connect to remotefs: localhost:6010
08-19 21:20:13.931: I/godot(32492): Godot Engine v2.1.4.beta.custom_build (c) 2008-2017 Juan Linietsky, Ariel Manzur.
08-19 21:20:13.931: I/godot(32492): Usage: apk [options] [scene]

very long usage page…

08-19 21:20:14.038: E/AndroidRuntime(32492): FATAL EXCEPTION: main
08-19 21:20:14.038: E/AndroidRuntime(32492): Process: org.asmstudio.spacecute, PID: 32492
08-19 21:20:14.038: E/AndroidRuntime(32492): java.lang.RuntimeException: Unable to resume activity {org.asmstudio.spacecute/org.godotengine.godot.Godot}: java.lang.NullPointerException
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2964)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2993)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.app.ActivityThread.access$800(ActivityThread.java:151)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.os.Handler.dispatchMessage(Handler.java:110)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.os.Looper.loop(Looper.java:193)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.app.ActivityThread.main(ActivityThread.java:5292)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at java.lang.reflect.Method.invokeNative(Native Method)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at java.lang.reflect.Method.invoke(Method.java:515)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at dalvik.system.NativeStart.main(Native Method)
08-19 21:20:14.038: E/AndroidRuntime(32492): Caused by: java.lang.NullPointerException
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at org.godotengine.godot.Godot.onResume(Godot.java:630)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1197)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at com.lbe.security.service.core.client.b.x.callActivityOnResume(Unknown Source)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.app.Activity.performResume(Activity.java:5343)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2950)
08-19 21:20:14.038: E/AndroidRuntime(32492): 	... 12 more

I’m guessing that the problem is in wrong remotefs connection address. The application on the device tried to connect to localhost:6010, but the debugger actually is on 10.0.0.242

But I don’t understand what settings should be for correct work.

I uncomment line 232 in main.cpp and it shows me this:

08-19 22:05:00.797: I/godot(3027): CMD: -rfs
08-19 22:05:00.797: I/godot(3027): CMD: localhost:6010
08-19 22:05:00.797: I/godot(3027): CMD: -rdebug
08-19 22:05:00.797: I/godot(3027): CMD: localhost:6007

I think it’s a bug. At least -rdebug must be 10.0.0.242:6007 according to my editor settings.

DrMoriarty | 2017-08-19 19:12

:bust_in_silhouette: Reply From: DrMoriarty

I’ve found the solution. I set Use remote debug over Adb which seems to be broken. When I unchecked this options debugging starts work.

OMG, this works here too o_o

I wonder why happens, I was unable to connect with older godot versions too and thought was some kind of adb fault.

eons | 2017-08-20 14:37