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

查看:35
本文介绍了将 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默认写入 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天全站免登陆