[英]Where can I find the xcresult logs from my application in an Xcode UI Test?
On running a UI Test, I can see the .xcresult
file generated in ~/Library/Developer/Xcode/DerivedData
.在运行 UI 测试时,我可以看到在
~/Library/Developer/Xcode/DerivedData
中生成的.xcresult
文件。 I have some NSLogs in my application that I need to display as well.我的应用程序中有一些 NSLogs 也需要显示。 Does anyone know where is the path to get the application log or xcresult file?
有谁知道获取应用程序日志或 xcresult 文件的路径在哪里?
The path your Xcode project's xcresult
files as of Xcode 14.1 is从 8825512549188 14.1 开始,您的 Xcode 项目的
xcresult
文件的路径是
/Users/USER_NAME/Library/Developer/Xcode/DerivedData/APPNAME-SOME_XCODE_ID/Logs/Test/Test-SCHEME_NAME-DATE.xcresult
So if your username is gran_profaci
, your app name is MyAwesomeApp
, your scheme name is AwesomeScheme
and you live in timezone UTC-5 your path would look something like this:所以如果你的用户名是
gran_profaci
,你的应用程序名称是MyAwesomeApp
,你的方案名称是AwesomeScheme
并且你住在时区 UTC-5 你的路径看起来像这样:
/Users/gran_profaci/Library/Developer/Xcode/DerivedData/MyAwesomeApp-aiupaskztadstnnevejnfigoiug/Logs/Test/Test-AwesomeScheme-2022.11.21_09-39-19--0500.xcresult
Each test you run will create a new xcresult file with the corresponding parameters and current date.您运行的每个测试都将创建一个新的 xcresult 文件,其中包含相应的参数和当前日期。
You can directly open the DerivedData folder from Xcode by clicking on the icon displaying a right arrow inside a circle:您可以通过单击圆圈内显示向右箭头的图标直接打开来自 Xcode 的 DerivedData 文件夹:
If you want to extract information you can use the xcparse command line tool , in your example to export the logs:如果您想提取信息,可以使用xcparse 命令行工具,在您的示例中导出日志:
xcparse logs /path/to/Test.xcresult /path/to/exportLogFiles
the path most likely appears on the terminal /Users//Documents/P/ios/build/<>/Logs/Test/Run-<.....>.xcresult该路径最有可能出现在终端 /Users//Documents/P/ios/build/<>/Logs/Test/Run-<.....>.xcresult
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.