Chisel is a facebook enhanced LLDB debugger plug-in that adds commands like pviews,show,hide, etc. See Chisel Wiki for more details

The installation

We can install Chisel using Homebrew, please stamp Homebrew install if you don’t have it installed

Having installed Homebrew, chisel can be installed directly using the following command

brew install chisel
Copy the code

.lldbinit

# ~/.lldbinit.command script import /usr/local/opt/chisel/libexec/fblldb.py
Copy the code

It can also be added under this file as described on Chisel Github

# ~/.lldbinit.command script import /path/to/fblldb.py
Copy the code

After adding, restart Xcode, open breakpoint to run, type help in LLDB, if the following information is displayed, chisel is successfully installed

use

Now that we can use Chisel’s commands in the LLDB, let’s look at a few commonly used commands

pviewsView the view hierarchy

pvcViewing controller Layers

fv/fvcSimilar to Pviews and PVC, search views and controllers. Support for regular

visualizeOpen a view using the MAC preview app

border/unborderAdd/remove boundaries to identify views

caflushUI changes do not need to run again, directly refresh the UI

taplogWhen you tap the screen, the screen pauses and prints the touched view on the console

presponder/pclassPrint response chain/inheritance chain

wivarSet Watchpoint, equivalent to KVO