繁体   English   中英

get Xcode console output 登录一个文件

[英]Get Xcode console output to log in a file

我正在运行一些 iOS 应用程序测试,并希望让 xcode 的控制台将其 output 记录到一个文件中。 有什么办法可以做到这一点?

有一个很棒的框架可以为你做这个(和其他日志记录方法)。 它被称为CocoaLumberjack

看一下将XCode 4控制台的调试输出重定向到日志文件。

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

在 mac 终端试试这个

从“关于”部分检查设备名称

sudo log collect --deviceName "NAME" --last 10m --output iphone_test1.logarchive

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM