Xcode 断点调试

0x01设置断点

  1. breakpoint set -n "[CMURLList setHomePageH5:]"
 Breakpoint 16: where = xxxile`-[CMURLList setHomePageH5:] + 80 at CMURLList.h:73:40, address = 0x00000001043800a8
  1. b -[CMURLList setNavigationH5Url:]
    在Xcode 中的break point中设置如: -[ CMWebViewController viewWillAppear:]

  2. po [[CMURLList sharedInstance] homePageH5];

  3. po [类名 _methodDescription] 打印类的所有方法和属性
    此方法在查看一些封装的类信息比较有用

0x02 BeakPoint 中AddAction

  1. symbol - [CMH5BusinessViewController viewWillAppear:]

    Debugger Commond: po expr lldb命令

  2. Log Message

参考地址

https://zhuanlan.zhihu.com/p/25254672

https://zhuanlan.zhihu.com/p/299501575

打印日志

  1. 打印框架结构_printHierarchy

    OC:  po [[[UIWindow keyWindow] rootViewController] _printHierarchy]
    
    swift : expression -l objc++ -o -- [[[UIWindow keyWindow] rootViewController] _printHierarchy]
    
  2. 打印界面view的信息recursiveDescription

     po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]
    
    expr -l objc++ -O -- [[[UIApplication sharedApplication] keyWindow] recursiveDescription]
    

你可能感兴趣的:(Xcode 断点调试)