Chisel-LLDB调试助手

Chisel is a collection of LLDB commands to assist debugging iOS apps.

在我查阅如何定位视图约束冲突相关博客资料的时候,了解到了Facebook开源的这款LLDB调试工具,通过Chisel可以轻松的找到约束有冲突的视图,自己以前只接触过Xcode自带LLDB工具,用的也不算太多,通过阅读相关文档,发现Chisel有很多实用的功能,比如说打印视图层级关系,通过命令添加断点,打印对象继承关系,预览打开UIImage、CGImageRef图片,显示隐藏视图或layer等等。

目录

  • GitHub地址
  • 安装
  • 常用常用Commands
  • 推荐博客

一、GitHub地址

Chisel

二、安装

brew install chisel
复制代码
  • 如果没有创建**.lldbinit**文件,则在终端创建文件
touch .lldbinit 
//open .lldbinit
复制代码
  • 编辑**.lldbinit**文件,并添加以下内容command script import /usr/local/opt/chisel/libexec/fblldb.py
vim .lldbinit

//添加以下内容
# ~/.lldbinit
...
command script import /path/to/fblldb.py
复制代码

最后wq保存,重启Xcode,就可以使用Chisel了。

三、常用Commands

命令命令描述iOSOS X
pviewsPrint the recursive view description for the key window.YESYES
pvcPrint the recursive view controller description for the key window.YESNO
visualizeOpen a UIImage, CGImageRef, UIView, CALayer, NSData (of an image), UIColor, CIColor, or CGColorRef in Preview.app on your Mac.YESNO
fvFind a view in the hierarchy whose class name matches the provided regex.YESNO
fvcFind a view controller in the hierarchy whose class name matches the provided regex.YESNO
show/hideShow or hide the given view or layer. You don't even have to continue the process to see the changes!YESYES
mask/unmaskOverlay a view or layer with a transparent rectangle to visualize where it is.YESNO
border/unborderAdd a border to a view or layer to visualize where it is.YESYES
caflushFlush the render server (equivalent to a "repaint" if no animations are in-flight).YESYES
bmessageSet a symbolic breakpoint on the method of a class or the method of an instance without worrying which class in the hierarchy actually implements the method.YESYES
wivarSet a watchpoint on an instance variable of an object.YESYES
presponderPrint the responder chain starting from the given object.YESYES
............

就介绍这么多了,现在自己用到的也并不算太多,做下记录,方便自己以后查阅,有兴趣的朋友可以自行了解其用法吧。

推荐博客

1、LLdb篇2教你使用faceBook的chisel来提高调试效率
2、Chisel-LLDB命令插件,让调试更Easy

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值