Debugging a C++ application on an Android device with VS2015 on Windows 10

VS2015 has an exciting ability to debug a C++ application on Android Emulator, but in this article I will talk about no less exciting and more time expensive ability to debug a C++ application on a real Android device. The first thing we need to spend the time with is figuring out how to enable USB debugging mode on our Android device. On my ASUS Zenfone I need to go to Settings->About->Software Information and tap on Build Number 7 times, after that I have USB debugging check box in Settings->Developer Options that I should tap as well:

enabling USB debugging mode on Android device USB debugging mode on Android device

I am not sure what ADB driver we should install on Windows 10 64 bit, because I tried a lot of them on my machine, but I think that next time I should start with Universal Adb Driver that can be easily installed with its Windows Installed package. After the driver installation is complete and Android device is connected with USB debugging mode enabled, the ADB interface should be listed in Windows Device Manager:

ADB interface listed in Windows Device Manager

now when I open some cross platform OpenGLES 2 applications in VS2015 and chose ARM configuration, the Android device appears in the Debug toolbar:

Android device in Visual Studio 2015

When I click on it (or press F5) my Zenfone shows rotating cube drawn with OpenGL ES 2:

and I even can set a breakpoint in C++ code and see the values of the variables:

a breakpoint in C++ code

Leave a Reply

Your email address will not be published.