在Android Studio下调试Native代码相对来说较为简单, 只是在整个过程中遇到了些问题, 在此记录下。
- 打开Run->Edit Configuration

这个错误是指需要允许jni
的调试, 在gradle
的debug
中添加jniDebuggable true
,如下:

- 编译后重复1操作, 提示:

这是因为没有安装lldb
,点击fix
就会下载安装:

- 至此, native调试环境已经好了, 接下来只需设断点,然后选择
native-app
方式debug
即可
网友评论