问题
在使用lldb 进行调试的时候发现报错
libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance.
这样就会导致每次调试都很慢,需要从内存中读取符号。
解决方法
这里先按照网上的方法
1.rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport
2.重新打开Xcode加载一次符号
这时候xcode里面调试正常了,但是我命令行里面的lldb还是不正常,索引不到符号,怀疑是lldb版本不一样。果然,使用的是homebrew 安装的llvm的lldb,先brew uninstall llvm,然后which 查看一下,还是不对,但是版本号对上了,然后我直接尝试
/Applications/Xcode.app/Contents/Developer/usr/bin/lldb
// 正常
应该还是二进制文件不对,使用Xcode-select 查询发现使用的是
/Library/Developer/CommandLineTools,这是一个精简的工具。
使用下面的命令切换后正常
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer