1,快捷鍵
快速找類(lèi)文件
CMD+Shift+O 快速查找項(xiàng)目中文件
CMD+Shift+J Project定位文件
快速找到方法
Ctrl+6
2,臨時(shí)打log的方法,無(wú)需重啟程序
編輯斷點(diǎn)--->選擇Action-->logMessage--->再點(diǎn)擊+--->選擇DebugerCommander--->pviews
一點(diǎn)要選擇automaticlly continue after evalating value
3,調(diào)試工具chisel
---(1)
安裝brew
curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh
---(2)
安裝chisel
brew update
brew install chisel
---(3)
添加lldb初始化腳本
來(lái)自上一步(2)中的提示
Add the following line to ~/.lldbinit to load chisel when Xcode launches:
command script import /usr/local/opt/chisel/libexec/fblldb.py
------------一些chisel命令
1,(lldb)pviews view等同于[view recursiveDescription]
2,(lldb)pvc等同于[UIViewController _printHierarchy]
3,(lldb)visualize imageView
4,(lldb)fv v / fvc v后面接類(lèi)名,打印出來(lái)的是地址
(lldb) fv label
0x7fd43bc10a60 UIButtonLabel
0x7fd43bfb41a0 UILabel(lldb)
fv UIButton
0x7fd43bfb16c0 UIButton
0x7fd43bc10a60 UIButtonLabel
5,(lldb)border 0x7fd43bfb41a0
參考命令border 0x7fd43bfb41a0 -c green -w 2
6,(lldb)pinternals self.view內(nèi)部結(jié)構(gòu) 變量等
7,(lldb)presponder self.view繼承于UIResponder的消息傳遞鏈
8,(lldb)pclass self.view該類(lèi)的繼承體系
9,(lldb)taplog模擬點(diǎn)擊屏幕 并打印接收對(duì)象
10,(lldb)bmessage -[MainViewController viewWillAppear:]進(jìn)入某方法時(shí)設(shè)置隱形斷點(diǎn)