LLDB Chisel Commands

Accessibility Commands

Print accessibility labels of all views in hierarchy of aView

(lldb) pa11y <aView>

Print accessibility identifiers of all views in hierarchy of aView

(lldb) pa11yi <aView>

Find the views whose accessibility labels match labelRegex and puts the address of the first result on the clipboard

(lldb) fa11y <aView>

AutoLayout Commands

Print the Auto Layout trace for the given view. Defaults to the key window

(lldb) paltrace [aView]

Put a border around views with an ambiguous layout

(lldb) alamborder

Removes the border around views with an ambiguous layout

(lldb) alamunborder

Class Dump

Print the class and instance methods of a class

(lldb) pmethods <instance/class>
-a / --address Print the implementation address of the method
-i / --instance Print the instance methods
-c / --class Print the class methods
-n / --name Take the argument as class name

Print the properties of an instance or class

(lldb) pproperties -n <className>

Print the block's implementation address and signature

(lldb) pblock <block>

Component Commands

Set debugging options for components

(lldb) dcomponents --set
(lldb) dcomponents --unset

Print a recursive description of components found starting from aView

(lldb) pcomponents <aView>

Display Commands

Show/hide a view or layer

(lldb) show <viewOrLayer>
(lldb) hide <viewOrLayer>

Draws a border around viewOrLayer. Color and width can be optionally provided. Additionally depth can be provided in order to recursively border subviews

(lldb) border <viewOrLayer>
(lldb) unborder <viewOrLayer>
-c <colorname>
-w <width>
-d <depth>

Add a transparent rectangle to the window to reveal a possibly obscured or hidden view or layer's bounds

(lldb) mask <viewOrLayer>
(lldb) unmask <viewOrLayer>

Force Core Animation to flush. This will 'repaint' the UI but also may mess with ongoing animations

(lldb) caflush

Present a view controller

(lldb) present <aViewController>

Dismiss a presented view controller

(lldb) dismiss <aViewController>

Slows down animations. Works on the iOS Simulator and a device

(lldb) slowanim

Turn off slow animations

(lldb) unslowanim

Flicker Commands

Quickly show and hide a view to quickly help visualize where it is

(lldb) flicker <viewOrLayer>

Find Commands

Find the view controllers whose class names match classNameRegex and puts the address of first on the clipboard

(lldb) fvc <classNameRegex>

Find the views whose class names match classNameRegex and puts the address of first result on the clipboard

(lldb) fv <classNameRegex>

Visualization Commands

Open a UIImage in Preview.app on your Mac

(lldb) showimage <anImage>

Open a CGImageRef in Preview.app on your Mac

(lldb) showimageref <anImageRef>

Render the given UIView into an image and open it in Preview.app on your Mac

(lldb) showview <aView>

Render the given CALayer into an image and open it in Preview.app on your Mac

(lldb) showlayer <aLayer>

Invocation Commands

Print the stack frame, receiver, and arguments of the current invocation. It will fail to print all arguments if any arguments are variadic (varargs)

(lldb) pinvocation [--all]

Note: sadly this is currently only implemented on x86.

Debug Commands

Set a watchpoint for an object's instance variable

(lldb) wivar <object> <ivarName>

Set a breakpoint for a selector on a class, even if the class itself doesn't override that selector. It walks the hierarchy until it finds a class that does implement the selector and sets a conditional breakpoint there

(lldb) bmessage <expression>
(lldb) bmessage -[MyView setFrame:]

Set a breakpoint for a relative address within the framework/library that's currently running. This does the work of finding the offset for the framework/library and sliding your address accordingly

(lldb) binside <address>

Simulate a memory warning

(lldb) mwarning

Print Commands

Print the recursion description of aView

(lldb) pviews <aView>

Print layer tree from the perspective of the render server

(lldb) pca

Print the recursion description of aViewController

(lldb) pvc <aViewController>

Prints if the code is currently execution with a UIView animation block

(lldb) panim

Print the inheritance starting from an instance of any class

(lldb) pclass <anObject>

Print the responder chain starting from a specific responder

(lldb) presponder <startResponder>

Print the highest table view in the hierarchy

(lldb) ptv

Print the visible cells of the highest table view in the hierarchy

(lldb) pcells

Show the internals of an object by dereferencing it as a pointer

(lldb) pinternals <anObject>

Print the value of an object's named instance variable

(lldb) pivar <anObject> <ivarName>

Print out the value of the key path expression using -valueForKeyPath:

(lldb) pkp <keyPath>

Print application's Documents directory path

(lldb) pdocspath

Print application's bundle directory path

(lldb) pbundlepath

Print the contents of NSData object as string

(lldb) pdata <data>
Supported encodings:
-ascii,
-utf8,
-utf16, unicode,
-utf16l (Little endian),
-utf16b (Big endian),
-utf32,
-utf32l (Little endian),
-utf32b (Big endian),
-latin1, iso88591 (88591),
-latin2, iso88592 (88592),
-cp1251 (1251),
-cp1252 (1252),
-cp1253 (1253),
-cp1254 (1254),
-cp1250 (1250

Print the actions and targets of a control

(lldb) pactions <control>

Print JSON representation of NSDictionary or NSArray object

(lldb) pjson <aDictOrArray>

Print the NSURLRequest (HTTP) as curl command

(lldb) pcurl <aRequest>

Print object and copy output to clipboard

(lldb) pbcopy <object>

Print the expression result, with the expression run in an ObjC++ context. (Shortcut for "expression -O -l ObjC++ --

(lldb) poobjc <expression>

Test Input Commands

Set text on text on a view by accessibility id

(lldb) settext <accessibilityId> <replacementText>

Input text into text field or text view that is first responder

(lldb) setinput <inputText>

Notes