序号 | 录入时间 | 录入人 | 备注 |
---|---|---|---|
1 | 2016-01-08 | Alfred Jiang | - |
Xcode - 使用 chisel 提高 LLDB 调试效率
Xcode \ 调试 \ 断点 \ 页面 \ 约束
- 需要对复杂页面进行调试时
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew install chisel
touch ~/.lldbinit echo "command script import /usr/local/opt/chisel/libexec/fblldb.py" >> ~/.lldbinit
brew upgrade chisel
(lldb)border 0x79ec3140 -c green -w 2
3. 通过 paltrace 命令查看是否存在 Ambiguous Layouts(AMBIGUOUS LAYOUT 即为约束冲突或不完善位置),该命令相当于对 View 调用 _autolayoutTrace
(lldb) paltrace
•UIWindow:0x7ff450d2fb50 - AMBIGUOUS LAYOUT
| •UIView:0x7ff450e14430
| | *_UILayoutGuide:0x7ff450d30e90
| | *_UILayoutGuide:0x7ff450d31230
| | *UIView:0x7ff450d32870- AMBIGUOUS LAYOUT for UIView:0x7ff450d32870.minX{id: 46}
Legend:
* - is laid out with auto layout
+ - is laid out manually, but is represented in the layout engine because translatesAutoresizingMaskIntoConstraints = YES
• - layout engine host
4. 通过 alamborder & alamunborder 命令为 Ambiguous Layouts(AMBIGUOUS LAYOUT 即为约束冲突或不完善位置)控件添加和删除边框颜色和边框的宽度
(lldb)alamborder
(lldb) pinternals model
6. 使用 pkp 命令打印属性,该命令是 po 命令的升级版,po obj.xxx 是调用 getter 方法,如果没有 getter 方法就无法打印了。 pkp obj.xxx 优先调用 getter 方法,没有 getter 方法会直接查找成员变量。
(lldb) pkp self.view
(lldb) flicker self.subView
caflush
(lldb) show 0x7fe713901f10
(lldb) hide 0x7fe713901f10
(lldb) visualize image
(无)
(无)