Code Coverage Not Accurate in Xcode 26

Description: I’m noticing that the code coverage metrics in Xcode 26 are not accurate compared to earlier versions.

In Xcode 15, the same set of unit tests shows around 38% coverage, but in Xcode 26, even though all the tests are running successfully (for example, the SegmentedUI test cases), the code coverage is displayed as 0%.

Has anyone else observed this behavior in Xcode 26? Is there any known issue, workaround, or configuration change required to get the correct coverage report?

Environment:

Xcode 26

iOS 18 SDK

Unit tests running under XCTest

Any insights or suggestions would be appreciated.

We are encountering the same issue since Xcode 16. We run XCTest and Swift Testing.

For us it is flaky, sometimes some local Packages (SPM) are missing in the .xcresult file, resulting in a Coverage of 0% for these packages

We are having this issue as well. Local packages sometimes report coverage, and then sometimes they just don't report it with no explanation. It appears pretty much random. I filed FB13204866 several years ago, but have seen no updates on it.

Same. Code coverage has been a mess for quite some time in Xcode -- my CI scripts have morphed over the years to try and overcome different issues that have popped up. It seems to me that Apple does not use this feature internally or else it would not be in such a bad state.

Thank you for reporting the issue. Could you please provide the version of Xcode 26.X and the build number you are experiencing the problem with? Thanks for the FB number, looks like you have also uploaded the sysdiagnose and screenshots, appreciated.

Is removing the DerivedData make any difference? Delete your Derived Data folder. Reopen Xcode and run > Clean Build Folder

In build settings search for CLANG_ENABLE_CODE_COVERAGE is it set to Yes?

For everyone else that didn’t file a bug. If you’re willing, could you please file a bug with sysdiagnose? Include the Xcode version and the details from my question above for the team?

Once you open the bug report, please post the FB number here for my reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

Albert
  Worldwide Developer Relations.

Code Coverage Not Accurate in Xcode 26
 
 
Q