将XCode 4控制台的调试输出重定向到日志文件 [英] Redirecting debug output from XCode 4 console to a log file

查看:333
本文介绍了将XCode 4控制台的调试输出重定向到日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为iPhone进行自动化测试,并且需要将输出从gdb重定向到日志文件。一些在线搜索在开始调试之前发现了以下两行命令行:

I'm working on automated testing for iPhone, and I need to redirect output from gdb to a log file. Some searching online turned up the following two lines to run at the command line before beginning debugging:

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

...但它们似乎不适合我。我以前遇到过问题,旧版Xcode的功能在新版本中消失了(我使用的是XCode 4.0.2)。是这种情况,还是更可能是我只是做错了什么?

...but they don't seem to work for me. I've had problems in the past with functionality from previous versions of Xcode disappearing in newer versions (I'm using XCode 4.0.2). Is that the case here, or is it more likely that I'm just doing something wrong?

是否有另一种方式告诉XCode发送输出到日志文件?请注意,我需要能够从命令行或AppleScript执行此操作;

Is there another way to tell XCode to send output to a log file? Note that I need to be able to do this from the command line or AppleScript; I can't add anything to the code of the program being run.

推荐答案

Xcode 4.0的域名是com.apple .dt.Xcode
另外,在Xcode 4.0中,您应该使用fol
defaults write com.apple.dt.Xcode IDEGDBLogToFile /tmp/logs.txt

The domain name of Xcode 4.0 is com.apple.dt.Xcode Also, in Xcode 4.0, you should use the fol defaults write com.apple.dt.Xcode IDEGDBLogToFile /tmp/logs.txt

这篇关于将XCode 4控制台的调试输出重定向到日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆