LLDB插件提升开发效率
LLDB插件的的配置使用以及安装过程中遇到的问题记录!
- chisel
facebook提供的lldb插件chisel。Github地址
利用brew安装
brew install chisel
配置.lldbinit文件,lldb在启动的时候会默认调用这个文件
cd ~/
touch .lldbinit (文件存在则忽略这一步)
// 在.lldbinit加入代码, 然后重启Xcode
command script import /usr/local/opt/chisel/libexec/fblldb.py
安装遇到的问题,控制台报异常
Xcode控制台报错
error: module importing failed: Missing parentheses in call to 'print'. Did you mean print('Whoops! You are missing the <' + arg.argName + '> argument.')? (fblldb.py, line 98)
File "temp.py", line 1, in <module>
经过查阅资料是Python版本问题。解决办法采用别人修改过版本。
在命令行中操作
cd ~/Downloads && git clone https://github.com/chenjiangchuan/chisel.git && cd chisel &&cp -f -R -v libexec /usr/local/Cellar/chisel/1.8.1
然后重启Xcode后控制台未报异常表示配置正确。
help 可以查看lldb支持的所有命令
- 另外一款LLDB插件
安装方法:
1、下载源代码存放到本地 我这里是存放在/opt/下,重命名为LLDB
2、在.lldbinit中添加本插件
/opt/LLDB/lldb_commands/dslldb.py
- 常用命令
pvc 打印当前控制器
pviews 递归答应视图结构
methods 答应NSObject子类的对象的所有方法
fv 查找UIView
fvc 查找UIViewController
hide 隐藏视图
show 显示视图
pmethods 打印类的类方法和实例方法
presponder 打印响应链条
pactions 打印响应方法
sbt 恢复符号表
search 查找视图或者控制器
更多命令用help查看