运行仪器的 UI 自动化时捕获 iPhone 控制台日志
在 Xcode 中,我可以使用“Run->Console”打开控制台来运行我的应用程序,然后执行“Build and Run”命令。现在我已经编写了一个 UI 自动化脚本,我想在捕获控制台日志时运行该脚本。当我在仪器中按“记录”时,我的应用程序的实例将启动并执行测试,但控制台上不会显示任何输出。有没有办法让两者并行运行?或者在运行 UI 自动化脚本时自动捕获应用程序控制台上显示的内容?
谢谢
In Xcode, I can run my application with the console open by using "Run->Console" and then executing a "Build and Run" command. Now I've written a UI Automation script that I would like to run while capturing the console log. When I press "record" in instruments, an instance of my application is started and the test is executed, but no output is displayed to the console. Is there a way to run the two in parallel? Or to automatically capture what would be displayed to the application's console when running a UI automation script?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一次通过 UI 自动化工具运行我的应用程序时,我在 Xcode 中打开 Organizer,发现控制台日志为空。因此,我相信日志甚至没有被写入管理器控制台。我发现这是我的 Xcode 版本中的一个错误,正如此堆栈溢出问题中所讨论的那样 (为什么当我连接 iPhone 时,XCode Organizer 控制台有时为空)。我最终能够在 UI 自动化运行时显示我的管理器控制台日志。
When running my application through the UI Automation tool the first time, I opened Organizer in Xcode and saw that the console logs were empty. Thus, I believed that the logs were not being written to even the Organizer console. I found that this was a bug in my version of Xcode as discussed in this stack overflow question (Why is XCode Organizer console sometimes empty when I connect my iPhone). I was eventually able to get my Organizer console log to display while the UI Automation was running.