有没有办法在没有连接到调试器时在iPhone上捕获NSLog的输出? [英] Is there a way to capture the output of NSLog on an iPhone when not connected to a debugger?

查看:116
本文介绍了有没有办法在没有连接到调试器时在iPhone上捕获NSLog的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 NSLog()记录大量数据。当我的iPhone没有连接到我的开发机器并在调试器下运行时,有没有办法捕获日志数据?

I'm logging a bunch of data with NSLog(). Is there a way to capture the log data when my iPhone is not connected to my development machine and running under a debugger?

例如,我可以将其重定向到文件,然后在稍后的时间点通过Xcode读取日志文件吗?我需要这样做,以便在WiFi很差时测试我的应用程序,这需要我远离我的办公桌。

For example, can I redirect it to a file and then read the log file back through Xcode at a later point in time? I need to do this in order to test my app when the WiFi is poor, which necessitates that I go far away from my desk.

推荐答案

我非常确定NSLog()调用将被写入系统控制台日志,因此如果您在离线后将iPhone连接到计算机,您应该能够在XCode Organizer中查看控制台日志。唯一需要注意的是控制台日志的大小有限,因此如果您进行大量日志记录,旧条目可能会被删除。

I'm pretty sure that NSLog() calls will be written to the system console log, so if you connect your iPhone to your computer after being offline, you should be able to look at the console log in XCode Organizer. The only caveat is that the console log is limited in size so older entries may be bumped off if you do a lot of logging.

这篇关于有没有办法在没有连接到调试器时在iPhone上捕获NSLog的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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