Chisel-LLDB调试助手

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

目录

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

一、GitHub地址

Chisel

二、安装

  • 未安装Homrebrew,先安装Homrebrew
    参考MAC上Homebrew常用命令
  • 安装Chisel

    1
    brew install chisel
  • 如果没有创建.lldbinit文件,则在终端创建文件

    1
    2
    touch .lldbinit 
    //open .lldbinit
  • 编辑.lldbinit文件,并添加以下内容command script import /usr/local/opt/chisel/libexec/fblldb.py

    1
    2
    3
    4
    5
    6
    vim .lldbinit

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

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

三、常用Commands

命令 命令描述 iOS OS X
pviews Print the recursive view description for the key window. YES YES
pvc Print the recursive view controller description for the key window. YES NO
visualize Open a UIImage, CGImageRef, UIView, CALayer, NSData (of an image), UIColor, CIColor, or CGColorRef in Preview.app on your Mac. YES NO
fv Find a view in the hierarchy whose class name matches the provided regex. YES NO
fvc Find a view controller in the hierarchy whose class name matches the provided regex. YES NO
show/hide Show or hide the given view or layer. You don’t even have to continue the process to see the changes! YES YES
mask/unmask Overlay a view or layer with a transparent rectangle to visualize where it is. YES NO
border/unborder Add a border to a view or layer to visualize where it is. YES YES
caflush Flush the render server (equivalent to a “repaint” if no animations are in-flight). YES YES
bmessage Set 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. YES YES
wivar Set a watchpoint on an instance variable of an object. YES YES
presponder Print the responder chain starting from the given object. YES YES

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

推荐博客

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

-------------本文结束感谢您的阅读-------------
分享到:
0%