-
Notifications
You must be signed in to change notification settings - Fork 0
Home
- brew update
- brew install chisel
如果已经安装,可更新最新版本 brew upgrade chisel
安装目录:
/usr/local/opt/chisel/libexec/fblldb.py
新建~/.lldbinit
文件
#目录路径
chiselDir=`pwd`/Util/chisel/fblld
8000
b.py
command="command script import $chiselDir"
echo $command >> ~/.lldbinit
- 隐藏一个视图/图层
- 显示一个视图/图层
- 查看视图位置
- 支持正则查找内存视图实例
- 支持正则查找控制器实例
- window添加透明框,检测视图/图层bounds
- 移除视图/图层的mask
- 移除视图/图层的边框border
- 预览.app查看组件样式
- 手动单步查找一个View
- 为实例变量添加一个观察断点
- 打印一个视图的自动布局堆栈
- 打印View动画执行事件
- 在渲染过程打印图层树
- 打印View视图层级
- 打印视图的tap事件
- 打印ViewController结构
- 打印tableView结构
- 打印可见cell的结构
- 打印一个实例的继承关系
- 打印一个对象的内部结构
- 打印对象实例的名字和变量值
- 打印一个Key的value通过表达式-valueForKeyPath:
- 打印从一个特定的响应点开始打印剩余响应链
Put a border around views with an ambiguous layout
选项:
--color/-c <color>;
类型:string; A color name such as 'red', 'green', 'magenta', etc. --width/-w <width>;
类型:CGFloat; Desired width of border.
语法: alamborder [--color=color] [--width=width]
Removes the border around views with an ambiguous layout
语法: alamunborder
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.
设置当前正在运行的框架/库中的相对地址的断点。这样做的工作找到的框架/库的偏移量,并相应地滑动您的地址。
参数:
<address>;
类型:string; Address within the currently running framework to set a breakpoint on.
语法: binside <address>
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.
设置类的选择器的断点,即使类本身不覆盖该选择器。它走层次结构,直到它找到一个类,实现了选择器,并设置有条件断点。
参数:
<expression>;
类型:string; Expression to set a breakpoint on, e.g. "-[MyView setFrame:]", "+[MyView awesomeClassMethod]" or "-[0xabcd1234 setFrame:]"
语法: bmessage <expression>
Draws a border around <viewOrLayer>. Color and width can be optionally provided.
参数:
<viewOrLayer>;
类型:UIView/NSView/CALayer *; The view/layer to border. NSViews must be layer-backed.
选项:
--color/-c <color>;
类型:string;
A color name such as 'red', 'green', 'magenta', etc. --width/-w <width>;
类型:CGFloat; Desired width of border.
语法: border [--color=color] [--width=width] <viewOrLayer>
Force Core Animation to flush. This will 'repaint' the UI but also may mess with ongoing animations.
强制核心动画刷新。这将重新绘制的UI还可以把正在进行的动作。
语法: caflush
Find the views whose accessibility labels match labelRegex and puts the address of the first result on the clipboard.
发现意见的可达性标签匹配labelregex提出的第一个结果的地址在剪贴板上。
参数:
<labelRegex>;
类型:string;
The accessibility label regex to search the view hierarchy for.
可达性标签的正则表达式搜索视图层次结构。
语法: fa11y <labelRegex>
Quickly show and hide a view to quickly help visualize where it is.
快速显示和隐藏一个视图,快速帮助可视化它在哪里。
参数:
<viewOrLayer>;
类型:UIView/NSView*; The view to flicker.
语法: flicker <viewOrLayer>
Find the views whose class names match classNameRegex and puts the address of first on the clipboard.
通过类名搜索当前内存中存在的view和viewController实例,支持正则搜索
参数:
<classNameRegex>;
类型:string; The view-class regex to search the view hierarchy for.
语法: fv <classNameRegex>
Find the view controllers whose class names match classNameRegex and puts the address of first on the clipboard.
通过类名搜索当前内存中存在的view和viewController实例,支持正则搜索
选项:
--name/-n <classNameRegex>;
类型:string; The view-controller-class regex to search the view controller hierarchy for. --view/-v <view>;
类型:UIView; This function will print the View Controller that owns this view.
语法: fvc [--name=classNameRegex] [--view=view]
Hide a view or layer.
隐藏一个指定的 UIView 或 层
参数:
<viewOrLayer>;
类型:UIView/NSView/CALayer *; The view/layer to hide.
语法: hide <viewOrLayer>
(lldb) show self.view
(lldb) hide self.view
也可以使用内存地址隐藏和现实view,比如通过 fv cate找到一个view后使用hide隐藏它 (lldb)fv cate 0x7fd5b6e06920 AlbumCategoryView (lldb) hide 0x7fd5b6e06920
Add a transparent rectangle to the window to reveal a possibly obscured or hidden view or layer's bounds
向窗口添加透明矩形,以显示可能隐藏或隐藏的视图或图层的边界
参数:
<viewOrLayer>;
类型:UIView/NSView/CALayer *; The view/layer to mask.
选项:
--color/-c <color>;
类型:string; A color name such as 'red', 'green', 'magenta', etc. --alpha/-a <alpha>;
类型:CGFloat; Desired alpha of mask.
语法: mask [--color=color] [--alpha=alpha] <viewOrLayer>
Print the Auto Layout trace for the given view. Defaults to the key window.
打印给定视图的自动布局跟踪。默认是key window
参数:
<view>;
类型:UIView *; The view to print the Auto Layout trace for.
语法: paltrace <view>
Prints if the code is currently execution with a UIView animation block.
代码打印操作:当一个UIView动画块执行时。
语法: panim
Print layer tree from the perspective of the render server.
从渲染服务器的角度打印图层树。
语法: pca
Print the visible cells of the highest table view in the hierarchy.
在视图结构中,打印tableView中可见cell。
语法: pcells
Print the inheritance starting from an instance of any class.
从任何类的实例打印继承。
参数:
<object>;
类型:id; The instance to examine.
语法: pclass <object>
Show the internals of an object by dereferencing it as a pointer.
通过引用它的指针显示一个物体的内部。
参数:
<object>;
类型:id; Object expression to be evaluated.
语法: pinternals <object>
Print the stack frame, receiver, and arguments of the current invocation. It will fail to print all arguments if any arguments are variadic (varargs).
打印当前调用的堆栈帧、接收器和参数。它将无法打印所有参数如果任何参数变长(变)。
NOTE: Sadly this is currently only implemented on x86. 可惜的是,目前仅在x86上实现。
选项:
--all/-a ;
Specify to print the entire stack instead of just the current frame.
语法: pinvocation [--all]
Print the value of an object's named instance variable.
参数:
<object>;
类型:id; Object expression to be evaluated. <ivarName>;
类型:; Name of instance variable to print.
语法: pivar <object> <ivarName>
Print out the value of the key path expression using -valueForKeyPath:
参数:
<keypath>;
类型:NSString *; The keypath to print
语法: pkp <keypath>
Print the responder chain starting from a specific responder.
参数:
<startResponder>;
类型:UIResponder *; The responder to use to start walking the chain.
语法: presponder <startResponder>
Print the highest table view in the hierarchy.
语法: ptv
Print the recursion description of <aViewController>.
打印viewController控制器层级结构。
参数:
<aViewController>;
类型:UIViewController*; The view controller to print the description of.
语法: pvc <aViewController>
(lldb) pvc self.mMDrawerController**
<MMDrawerController: 0x7fd5b658b8c0;
view = <UIView; 0x7fd5b658cd00>; frame = (0, 0; 375, 667)>
| <SampleAlbumListVC: 0x7fd5b658bc90;
view = <UIView; 0x7fd5b66be7a0>; frame = (0, 0; 375, 667)>
| <SlideMenuVC: 0x7fd5b6589b50;
view = <UIView; 0x7fd5b684f790>; frame = (inf, inf; 0, 0)>
Print the recursion description of <aView>. 打印视图的层级结构:
Arguments 参
8D19
数:
<aView>;
类型:UIView*/NSView*; The view to print the description of.
Options 选项:
--up/-u ;
Print only the hierarchy directly above the view, up to its window.
--depth/-d <depth>;
类型:int; Print only to a given depth. 0 indicates infinite depth.
语法: pviews [--up] [--depth=depth] <aView>
(lldb) pviews self.window
|<UIWindow: 0x7fd5b6816780;
frame = (0 0;
375 667);
gestureRecognizers = <NSArray: 0x7fd5b6817770>;
layer = <UIWindowLayer: 0x7fd5b68263f0>>
| <UILayoutContainerView: 0x7fd5b6941780;
frame = (0 0;
375 667);
autoresize = W+H;
gestureRecognizers = <NSArray: 0x7fd5b694fc10>;
layer = <CALayer: 0x7fd5b6931250>>
| <UINavigationTransitionView: 0x7fd5b6949620;
frame = (0 0;
375 667);
clipsToBounds = YES;
autoresize = W+H;
layer = <CALayer: 0x7fd5b6946e20>>
Show a view or layer.
显示和隐藏一个指定的 UIView
参数:
<viewOrLayer>;
类型:UIView/NSView/CALayer *; The view/layer to show.
语法: show <viewOrLayer>
Log tapped view to the console.
语法: taplog
Removes border around <viewOrLayer>.
参数:
<viewOrLayer>;
类型:UIView/NSView/CALayer *; The view/layer to unborder.
语法: unborder <viewOrLayer>
Remove mask from a view or layer
参数:
<viewOrLayer>;
类型:UIView/CALayer *; The view/layer to mask.
语法: unmask <viewOrLayer>
Open a UIImage, CGImageRef, UIView, or CALayer in Preview.app on your Mac.
使用预览.app打开:UImageView CGImageRef UIView CALayer
参数:
<target>;
类型:(id); The object to visualize.
语法: visualize <target>
visualize uiimageview
Interactively search for a view by walking the hierarchy.
参数:
<view>;
类型:UIView*; The view to border.
语法: vs <view>
Set a watchpoint for an object's instance variable.
参数:
<object>;
类型:id; Object expression to be evaluated. <ivarName>;
类型:; Name of the instance variable to watch.
语法: wivar <object> <ivarName>