vscode调试 调试so
2020-09-16 本文已影响0人
zjfclimin
背景
编译flutter和cronet(chromium分离)在android --AS 环境中使用会导致调试困难,所以下面是用VScode进行调试的步骤
编译
编译出so,报错符号so
首次调试,利用AS将lldb推到APP的沙盒里, 重启进程
AS步骤利用终端启动沙盒lldb-server
127|blueline:/ $ run-as tv.athena.service.demo
查看是否存在
lldb
修改权限
blueline:/data/data/tv.athena.service.demo $ chmod -R 755 lldb/bin/*
启动server
blueline:/data/data/tv.athena.service.demo $ lldb/bin/lldb-server platform --server --listen unix-abstract:///data/local/tmp/debug.sock
找到pid
pid写AS的launch.json文件
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "lldb",
"request": "attach",
"pid":19621,
"initCommands": [
"platform select remote-android",
"platform connect unix-abstract-connect:///data/local/tmp/debug.sock"
],
"postRunCommands": [
"target symbols add [so-path]",
"settings set target.source-map [old-path] [new-src-path]"
],
}
]