MobileNativeFoundation / XCLogParser

Tool to parse Xcode and xcodebuild logs stored in the xcactivitylog format
Apache License 2.0
1.72k stars 121 forks source link

xclogparser parses the second to the latest .xcactivitylog #146

Closed yongjincho92 closed 1 year ago

yongjincho92 commented 2 years ago

As noted in the README for XCLogParser, .xcactivitylog file is generated a few seconds after the build action is completed. I added the xclogparser parse command into the build's post action and what I see is that the xclogparser parses the xcactivitylog for the second to the latest build log.

I am using Xcode 12.5.1 and I am not sure if this is by design or a bug. Can someone also confirm that adding xclogparser as the post build action is guaranteed to wait for the latest .xcactivitylog file to be generated and then parse it?

polac24 commented 2 years ago

Hi! No, XCLogParser doesn't retry if .xcactivitylog is invalid.

For your scenario with post build action, you can use XCMetrics, which actually validates .xcactivitylog and retries if is not ready yet:

https://github.com/spotify/XCMetrics/blob/0f449cc9dc328de3fcd85e08edec18f43da3a041/Sources/XCMetricsClient/Log%20Management/LogManager.swift#L128-L155

dezinezync commented 2 years ago

...am using Xcode 12.5.1 and I am not sure if this is by design or a bug.

I can reproduce the same with Xcode Version 13.3 (13E113)

Adding something along the lines of sleep 5; before executing xclogparser... in the post-build section does not work either.

PatrikBillgren commented 1 year ago

Closing since the original question is answered