LLDB常用调试命令

p:用于输出基本类型

(lldb) p self.view.subviews.count
(NSUInteger) $1 = 3

po:用于输出 Objective-C 对象

(lldb) po self.view
>

bt:打印调用堆栈

(lldb) bt
* thread #1: tid = 0x5b3ae, 0x0000000101bef1ee libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000101bef1ee libobjc.A.dylib`objc_exception_throw
    frame #1: 0x00000001021e6bdf CoreFoundation`-[__NSSingleObjectArrayI objectAtIndex:] + 111
  * frame #2: 0x0000000101608673 demo`-[ViewController viewDidLoad](self=0x00007fd73c8060f0, _cmd="viewDidLoad") + 163 at ViewController.m:24
......

call:调用的意思

(lldb) call [self.view setBackgroundColor:[UIColor redColor]]

继续运行程序可以看到view的背景颜色变成红色的了

更多
http://www.jianshu.com/p/073979bccd2f
http://www.jianshu.com/p/8e9fc9a8ab78

你可能感兴趣的:(LLDB常用调试命令)