运行 UITests 时如何检索应用程序日志?

问题描述 投票:0回答:1

如上所述,有什么方法可以使用 Xcode 14 检索应用程序日志,而不仅仅是测试日志?我在 xcresult 文件中看到的只是 Runner 的日志,但在通过 Xcode 或通过 cli 运行时我还需要应用程序日志

ios xcode logging ui-automation uitest
1个回答
0
投票

Xcode 15

Reveal Diagnostics in Finder
上下文菜单消失了,这看起来很奇怪。我目前面临与 this Apple 开发论坛帖子中描述的相同问题,我打开了反馈报告 FB13615178。

在此期间,您可以使用

xcresulttool

获取对象图以获取要导出的对象的 ID。

xcrun xcresulttool graph --path YourResult.xcresult/ > graph.log

搜索

StandardOutputAndStandardError
以查看它在图表中的位置。获取其ID并导出:

xcrun xcresulttool export \
--type directory \
--path YourResult.xcresult/ \
--output-path ./Output \
--id <ID-HERE>

Xcode 14 上:在 Xcode 中打开

.xcresult
,右键单击测试,然后选择
Reveal Diagnostics in Finder
。您应该看到您的模拟器文件夹,并且在其中一个文件夹中您将看到
StandardOutputAndStandardError-bundle-id.txt
文件。

© www.soinside.com 2019 - 2024. All rights reserved.