I'm try to redirect gdb output from XCode to a log file for automated testing. I've automated the process of running an app for testing using AppleScript, but I need to be able to see the output. I've tried using the .gdbinit file with
set logging file <filepath>
set logging overwrite on
set logging on
but I get “warning: Current output protocol does not support redirection” in my log file. A bit of searching for this error message didn't turn up much, besides a mention of a problem with "TUI-mode." If this is the problem, how do I turn off TUI-mode in XCode? If not, what is causing that warning?
As per an answer to this question: Redirecting debug output from XCode 4 console to a log file
You can use this system default to log Xcode's GDB output to a file:
defaults write com.apple.dt.Xcode IDEGDBLogToFile /tmp/logs.txt
It works for me with Xcode 4.2. Just make sure to restart Xcode after you set that default.
Try adding this to the top of your
.gdbinit
: