xcodestack-trace

Xcode full stack trace


While debugging is there anyway to see a complete stack trace (i.e., a list of methods called in the main thread) on the command window?


Solution

  • You can print the stack trace in the NSLog by

    NSLog(@"Stack trace : %@",[NSThread callStackSymbols]);
    

    Upon a crash, next to the word (lldb), you can type:

    po [NSThread callStackSymbols]
    

    Edit:

    For better output on console on Swift you can use following line instead:

    Thread.callStackSymbols.forEach{print($0)}