2012-10-03 100 views

回答

0

有一個很棒的框架可以爲你做這個(和其他日誌記錄方法)。這就是所謂的CocoaLumberjack

0

看看Redirecting debug output from XCode 4 console to a log file.

defaults write com.apple.Xcode PBXGDBDebuggerLogToFile YES 
defaults write com.apple.Xcode PBXGDBDebuggerLogFileName <filepath> 

/Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin 

#!/bin/sh 

/Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin- $* | tee -a $HOME/tmp/xcode-gdb.log 2>&1 
+1

由於某些版本的Xcode,該解決方案將不再有效 – Berik

+0

@Berik有一個替代的解決方案? – user2924482