让lldb功能更强大 调试程序会更方便
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
同时也可以借助一些私有 API 来实现快速查找 ViewController,使用[[[UIWindow keyWindow] rootViewController] _printHierarchy].toString(),可以发现打印结果中同样可以找到 SKUIStorePageSectionsViewController
我们想要断点的方法是 _buttonAction,它所在的类是 SKUIOfferView,那么可以使用 LLDB 输入 po [SKUIOfferView _shortMethodDescription] 来看下效果:(更多强大的黑科技私有函数可以参考这里: 强大的黑科技 私有参数
http://iosre.com/t/powerful-private-methods-for-debugging-in-cycript-lldb/3414)