Is it possible to debug C/C++ in Android Studio?

前端 未结 6 1594
时光取名叫无心
时光取名叫无心 2020-12-14 17:04

I\'m writing an Android app that includes C/C++ code that is compiled alongside the Java code. My app is crashing during the execution of the native code.

Is there

6条回答
  •  再見小時候
    2020-12-14 17:47

    Yes, Android Studio does support C++ debugging at least with Android studio 1.5.1 and android-ndk-r10e.

    In the old days, you will have to write make files Android.mk and Application.mk in order to build the C++ code in Android Studio. You don't need them any more. As long as you put them under the jni folder, gradle will be able to pick it up and compile it. You should see something like the following:

    And also allow you to set break point and debug it.

    You should follow this step-by-step tutorial and learn more about it. And read more about the documentation here. I've uploaded a complete working example so that you can download and try it out on GitHub.


提交回复
热议问题