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

前端 未结 6 1614
时光取名叫无心
时光取名叫无心 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:46

    With Android Studio 1.4 from tools.android.com, debugging is possible. When you open/create a project with C++[jni] code in it, Android studio would create a new configuration, something like $(module_name)-native

    I would select this configuration, sync gradle, build, set breakpoint etc and run it with Android Studio. After a long wait, my debugger is connected, app is broken in[I think you could also set breakpoint at this time]; this break is not at my set break points, I let it go in android studio and my breakpoint is hit. Hope this helps
    Some samples are supposed to work with android debugger

提交回复
热议问题