How do I debug the engine on Android?

I have a blueprint-only project but rendering on my target device looks totally broken:


After installing TADP/NVPACK as described on the [Android Getting Started][2] page, I haven’t been able to successfully attach to the ADB debugger over USB in Visual Studio.

I’ve attached a second instance of Visual Studio to my debugging instance so I can read the console output.

I select Debug → Attach to Process…, choose ‘Android’ as my transport type, and enter my device id in the ‘Qualifier’ field. If I then select ‘Show processes from all users’ and ‘Refresh’. At this point the debug console says:

[RedirProcess] C:\NVPACK\android-sdk-windows\platform-tools\adb.exe "-s 015d4b337a4c1e14 shell ps"
[RedirProcess] exited (True) in 78 ms
[RedirProcess] stdout:
USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
root      1     0     692    548   ffffffff 00000000 S /init
root      2     0     0      0     ffffffff 00000000 S kthreadd
... lots more processes ...

and the process appears in the selection dialog. I select the com.epicgames.MyGameName process from the list and select “Attach”. The debug console says:

[AndroidPackage] OnModeChange: DBGMODE_Run
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.WebClient.Diagnostics.HtmlToolHost\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.WebClient.Diagnostics.HtmlToolHost.dll'. Symbols loaded.

but doesn’t specify any adb commands it is using to do so. The title of the VS window changes to ‘UE4 (Running)’, but breakpoints don’t seem to work, and the ‘pause execution’ and ‘stop debugging’ buttons don’t do anything, and the app remains responsive on my connected device. At this point, nothing happens until I select Debug → Detach all, which then returns me to regular VS edit mode and emits the following to the VS debug console:

[AndroidPackage] OnModeChange: DBGMODE_Design
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'COM2InteropEmit'. 

I’m kind of stuck as to what to do next.

I’m running an unrooted Nexus 7 in developer mode.

FYI: still unable to debug successfully on UE4.6.1, both blueprint-only and c++ projects. I now have a Nexus 9 running Android 5.0.1 Lollipop

I can get working games now – HDR lighting path is broken on Nexus 7, see Nexus 7 HDR lighting path is broken - Rendering - Epic Developer Community Forums – but I’m using Nexus 9 now and it works great.

But I still can’t attach the debugger to any project, and I’ve tried lots of different projects, including quite minimal extensions of an empty project with some C++ code.

did you check logcat? there might be some hint why you game looks liek it looks. Also did you tried mobile examples?

did u find any solution ?

Has anyone checked this link here? Android Debugging | Unreal Engine Documentation

It used to work like a charm on my device. The last engine release (as of now UE 4.25.1) still works, but the debugger sometimes detaches unexpectedly. BTW if anyone knows a workaround for this issue, I appreciate, it is annoying sometimes. But apart from that, it all works like a charm.