How to create an xccovreport from an xcresult bundle.

We are having an issue when trying to view the the coveage report in our "merged result bundle"

Running xccov view --report --only-targets merged.xcresult results in:

09:52:54 Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load coverage archive in scheme action '(null)' in result bundle" UserInfo={NSLocalizedDescription=Failed to load coverage archive in scheme action '(null)' in result bundle, NSUnderlyingError=0x7f8ff8714f30 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/tmp/action.xccovarchive/Metadata.plist, NSUnderlyingError=0x7f8ff8714930 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}

Checking the man page for xccov I was inspired by the idea of extracting the coverage report from the result bundle to try to understand or work around our error.

The man xccov page states that

If xccov is passed a result bundle directly, it will extract the report or archive implicitly, as part of the action being requested. Alternatively, the raw report/archive files can be extracted from the result bundle using xcresulttool(1) and subsequently passed to xccov.

Checking man xcresulttool and trying out some stuff randomly I was not able to learn how a person might:

Given an xcresult bundle use xcresulttool to create/extract an xccovreport bundle.

Hi I am facing similar issue. Do you have a fix for it

Hi I'm also facing this now. Is there any solution? I notice there is 1K + upvotes. What's the way to request debugging or alternate to this?

Xcode version: Xcode_14.3

any progress on it ?

Any update on this issue as we are unable to generate code coverage in our CI due to this issue

any update here? How Apple wants to use Xcode Cloud if it's too limited features.

Hi guys, after a lot of hours with on a new re-check for all steps, I found my error!!!!

If it helps anyone, check in all schemes, that the Coverage property is set for all targets.

@cplaza Awesome that you resolved this! I've been dealing with a similar situation.

When you say all schemes, what do you mean? Do you have some custom CocoaTouch Frameworks added to your project that each have a scheme? Do your projects live inside of a workspace?

How to create an xccovreport from an xcresult bundle.
 
 
Q