Using chisel with LLDB

Installation Install Install Configuration After installation, copy the following line into your file. If the file doesn't exist, create it. Make sure to replace with your actual path — if you can't figure this out, maybe software development isn't for you; it's a tough career. add the following line to your ~/.lldbinit file. If it doesn't exist, create it. Note: if you encounter permission issues, prepend . Common Commands These are Python-wrapped functions. It's worth exploring their implementations if you have time. Personally, I find some of them very useful. alamborder Adds a border to views with ambiguous layouts, making it easy to identify which views have issues. - : Border color. String parameter, e.g., , , . Defaults to red. - : Border width. CGFloat parameter. Defaults to 2. Example: If any view has an ambiguous layout, the UIWindow border also turns red. This effectively catches ambiguous layouts where the width or height is 0 — which are otherwise easy to miss. alamunborder Removes the borders added by . paltrace Prints detailed Auto Layout information for a view, equivalent to calling . - : The view to print details for. Defaults to if no argument is provided. Example: pviews Recursively prints the view hierarchy, equivalent to calling the command. - : Starting from the specified view, prints upward through the hierarchy until the window level. - : Integer value. Specifies the print depth. 0 means no limit. Example — printing the app's view hierarchy: pvc Recursively prints the view controller hierarchy. - : The view controller to print. Defaults to the current VC if no argument is provided. Example — print the current VC: pclass Recursively prints the class inheritance chain. - : The object whose class hierarchy you want to print. Example — print the inheritance chain of the current controller: presponder Prints the responder chain. - : A UIResponder object indicating the start of the responder chain. Example — print the responder chain for the current controller: ptv Prints the table view currently displayed on screen. Primarily used together with . If there are multiple table views, prints the topmost one in the view hierarchy. Example: pcells Prints the currently visible cells in the table view. If there are multiple table views, uses the topmost one in the view hierarchy. pinternals Prints the internal instance variables of an object. I typically use this to inspect model properties. - : The object whose internal instance variables you want to print. Example — print the internal properties of the current table view (output is lengthy): pdata Decodes and prints encoded , equivalent to calling . - : The NSData object to print. - : Encoding type. Defaults to utf8 if omitted. Supported types include: pkp Prints the value at a key path using . - : The key path to print, e.g., . Note: Previously was commonly used to print properties. Now is a better choice, because calls the getter method and fails if there is no getter. not only calls the getter but also falls back to looking up instance variables directly. fvc Finds a view controller by its class name. - : String parameter. Finds view controllers by class name. - : UIView parameter. Finds the view controller that owns the given view. Note: These two options cannot be used together. The search is case-insensitive. Note: The search is substring-based — any class name containing the search string will be returned. Example — find : Example — find the owning VC by a view's memory address: fv Finds a view by its class name. - : The view's class name. Note: The search is substring-based — any class name containing the search string will be returned. Example — find table views on screen: taplog Prints the view that was tapped. Very helpful for identifying specific views. Note: The view must be able to receive tap events — its must be . and have by default. Example — pause the program first, then enter : The program automatically resumes. Tap a cell: vs Searches for and visually highlights a view in the view hierarchy. - : The view to find. Note: Compared to , is primarily used to show a view's position on screen. The two commands work well together. Example — find a cell using first: Then use to identify which one you're looking for — the corresponding cell turns pink: The console also logs the view. Six sub-commands are available: - : Move to the superview - : Move to the first subview - : Move to the previous sibling - : Move to the next sibling - : Print the hierarchy - : Quit If this isn't the view you're looking for, use , , , , to keep navigating: Quitting with even gives you a friendly message: caflush Refreshes the UI. When you modify the UI via LLDB commands, the interface does not update immediately. Use to flush the display. border Adds a border to a view or layer. - : Border color. String parameter, e.g., , , . Defaults to red. - : Border width. Defaults to 2. - : The view or layer to add the border to. Example — add a border to a found view: unborder Removes the border from a view or layer. mask Adds a semi-transparent rectangular mask to a view to visualize its position. - : Mask color. String parameter, e.g., , , . Defaults to red. - : Mask opacity. Defaults to 0.5. - : The view or layer to add the mask to. Primarily useful for locating hidden views. unmask Removes the mask added by . - : The view or layer to remove the mask from. show Shows a view or layer, equivalent to . hide Hides a view or layer, equivalent to . - : The view or layer to hide. slowanim Slows down animations. - : Animation speed. Higher values mean faster animation. 1 is the original speed. Defaults to 0.1 if no argument is provided. unslowanim Cancels the effect and restores normal animation speed. wivar Sets a watchpoint on an instance variable of an object. - : The object on which to set the watchpoint. Must be of type . - : The name of the instance variable. Note: properties typically have a corresponding instance variable with a prefix. Example — set a watchpoint on . bmessage Sets a breakpoint by method name. - : The method name for the breakpoint, e.g., , , . Note: When setting a regular breakpoint, if the method is implemented in a superclass rather than the current class, the breakpoint won't work. avoids this limitation — it sets the breakpoint successfully even if the current class doesn't implement the method. References: facebook/chisel LLDB Tips with chisel