android studio 2.2.2/2.3 调试ndk遇到的一个奇怪问题

有哪个大神帮我解决这个问题。

我的Android studio 工程 :http://download.csdn.net/detail/caizhigui/9801055

工程做了事情

NDK开发-之1——as2.3中新建工程自定义方法及日志打印


下面开始问题描述:



我在笔记本上可以正常调试一切都ok(用模拟器测试)


可是在pc上安装一样的环境,就是死活进不了C++ 代码的调试。(同一个android stuido 工程)

ndk工程下载地址:http://download.csdn.net/detail/caizhigui/9801055

CzgLenrnNDKTest


======console刚开始提示:



04/01 10:55:26: Launching app
No apk changes detected since last installation, skipping installation of E:\czg\czgAs\CzgLenrnNDKTest\app\build\outputs\apk\app-debug.apk
$ adb shell am force-stop czg.com.czglenrnndktest
$ adb shell am start -n "czg.com.czglenrnndktest/czg.com.czglenrnndktest.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Connecting to czg.com.czglenrnndktest
Now Launching Native Debug Session
Starting LLDB server: /data/local/tmp/lldb/bin/start_lldb_server.sh /data/local/tmp/lldb unix-abstract /data/local/tmp/lldb/tmp platform-1491015327774.sock "lldb process:gdb-remote packets"
$ adb shell cat /data/local/tmp/lldb-server | sh -c 'cat > /data/local/tmp/lldb/bin/lldb-server && chmod 700 /data/local/tmp/lldb/bin/lldb-server'
$ adb shell cat /data/local/tmp/start_lldb_server.sh | sh -c 'cat > /data/local/tmp/lldb/bin/start_lldb_server.sh && chmod 700 /data/local/tmp/lldb/bin/start_lldb_server.sh'

======console  ===然后提示  =(死活进不了c++断点,可以进入java断点)

Connected to the target VM, address: 'localhost:8649', transport: 'socket'





=====可以调试的情况



不能调试的情况:



更改这个jkd也是不行,奇怪


这是可以调试的控制台信息:

No apk changes detected since last installation, skipping installation of D:\AndroidStudioApp\CzgLenrnNDKTest\app\build\outputs\apk\app-debug.apk
$ adb shell am force-stop czg.com.czglenrnndktest
$ adb shell am start -n "czg.com.czglenrnndktest/czg.com.czglenrnndktest.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Connecting to czg.com.czglenrnndktest
Now Launching Native Debug Session
Starting LLDB server: /data/local/tmpdb/bin/start_lldb_server.sh /data/local/tmpdb unix-abstract /data/local/tmpdb/tmp platform-1491021708955.sock "lldb process:gdb-remote packets"
$ adb shell cat /data/local/tmpdb-server | sh -c 'cat > /data/local/tmpdb/bindb-server && chmod 700 /data/local/tmpdb/bindb-server'
$ adb shell cat /data/local/tmp/start_lldb_server.sh | sh -c 'cat > /data/local/tmpdb/bin/start_lldb_server.sh && chmod 700 /data/local/tmpdb/bin/start_lldb_server.sh'
Debugger attached to process 15299

不可调试的控制台信息:

No apk changes detected since last installation, skipping installation of E:\czg\czgAs\CzgLenrnNDKTest\app\build\outputs\apk\app-debug.apk
$ adb shell am force-stop czg.com.czglenrnndktest
$ adb shell am start -n "czg.com.czglenrnndktest/czg.com.czglenrnndktest.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Connecting to czg.com.czglenrnndktest
Now Launching Native Debug Session
Starting LLDB server: /data/local/tmp/lldb/bin/start_lldb_server.sh /data/local/tmp/lldb unix-abstract /data/local/tmp/lldb/tmp platform-1491015327774.sock "lldb process:gdb-remote packets"
$ adb shell cat /data/local/tmp/lldb-server | sh -c 'cat > /data/local/tmp/lldb/bin/lldb-server && chmod 700 /data/local/tmp/lldb/bin/lldb-server'
$ adb shell cat /data/local/tmp/start_lldb_server.sh | sh -c 'cat > /data/local/tmp/lldb/bin/start_lldb_server.sh && chmod 700 /data/local/tmp/lldb/bin/start_lldb_server.sh'


认真看没有什么差别:

google找:unable to debug ndk with android stuido

stackoverflow 论坛上也有人提出了这个问题
http://stackoverflow.com/questions/40595702/problems-debugging-native-code-in-android-studio-2-2-1-lldb2-2-and-ndk13

同类问题

国内作者解决方案(低版本都可以实现,真是高手)



这个大神的android 工程我下载下载不能用提示cpu的类型问题(那么我的模拟器是不是跟cpu类型有关呢)


查阅了大量文献,没有解决方案

谷歌的:Create and Edit Run/Debug Configurations

谷歌的调试你的应用:https://developer.android.com/studio/debug/index.html#breakPoints

谷歌的android ndk 教程:https://developer.android.com/ndk/index.html

谷歌ndk实例:https://github.com/googlesamples/android-ndk


问题解决:之前的所以操作都是在虚拟机上调试,后来抱着侥幸的心理用手机测试既然可以,不过调试速度非常慢。等待网友的解决方案。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

牵手生活

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值