I am developing android app using NDK. I have two projects. One is for my native library which uses NDK and generates .so file.
I am using Android Studio but disabling auto build and enabled build using ndk-build. I am using Windows 7.
Now after generating .so file I copy those in my main application project which also uses ndk-build to compile JNI functions in which I am calling functions of my library. I hope I am clean till this point. If not then I will give more detail on request.
Now I am running my application in device using Android Studio and I can put break point in java code and debug that code but I am not able to debug JNI call and also native code which I have in separate project. I need to debug inside my library code. So is there any way to achieve this?
I have seen VisualGDB but it is paid. So let me know if there is any alternative to full fill my debugging requirements.I have searched lot but did not get any concrete solution.
I can see option in Android Studio for attaching to android process where I can see my running device but I am not sure how to use it so I can debug by native library code (which is in separate project without any activity).
Let me know if more detail is required
The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.
To start debugging an APK, click Profile or debug APK from the Android Studio Welcome screen. Or, if you already have a project open, click File > Profile or Debug APK from the menu bar. In the next dialog window, select the APK you want to import into Android Studio and click OK.
In Android Studio 2.0 preview the process is a bit different (ans easier I think):
If it doesn't work, check that your native configuration has debug type "Hybrid" selected: On the right of the play button, click the little triangle, select "Edit Configurations", select your "app-native" configuration, go in the "Debugger" tab and select "Debug type: Hybrid".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With