讓lldb功能更強(qiáng)大 調(diào)試程序會(huì)更方便
1.打開終端窗口 依次輸入
git clone https://github.com/facebook/chisel.git
git clone https://github.com/DerekSelander/LLDB.git
# ~/.lldbinit
command script import /Users/apple/chisel/fblldb.py
command script import /Users/apple/LLDB/lldb_commands/dslldb.py
xcode LLDB 模式下輸入 command source ~/.lldbinit
即可
pvc
search
pviews
presponder
pactions 0xxxxxx
methods 0xxxxxx
具體命令可以查看github
157870000000
66778700000014044970
uiview
uiwindow
uiviewcontroller
同時(shí)也可以借助一些私有 API 來實(shí)現(xiàn)快速查找 ViewController,使用[[[UIWindow keyWindow] rootViewController] _printHierarchy].toString(),可以發(fā)現(xiàn)打印結(jié)果中同樣可以找到 SKUIStorePageSectionsViewController
我們想要斷點(diǎn)的方法是 _buttonAction愚铡,它所在的類是 SKUIOfferView还绘,那么可以使用 LLDB 輸入 po [SKUIOfferView _shortMethodDescription] 來看下效果:(更多強(qiáng)大的黑科技私有函數(shù)可以參考這里: 強(qiáng)大的黑科技 私有參數(shù)
http://iosre.com/t/powerful-private-methods-for-debugging-in-cycript-lldb/3414)