美文网首页
Xcode动态调试app利器 LLDB 让你工作效率提升N倍

Xcode动态调试app利器 LLDB 让你工作效率提升N倍

作者: A橙汁不加橙 | 来源:发表于2018-08-14 09:14 被阅读0次

    让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)

    相关文章

      网友评论

          本文标题:Xcode动态调试app利器 LLDB 让你工作效率提升N倍

          本文链接:https://www.haomeiwen.com/subject/pilmbftx.html