We have been having this problem since Xcode 7 beta and the problem persists to this day with Xcode 7.1.
Basically we cannot turn ON code coverage in Xcode. In Xcode 6, this worked fine, but has been broken ever since Xcode 7. At the end of a unit test run, we get infinite console output saying:
profiling: /Users/<my path to app>/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (<some hex address>)
This output repeats until the app crashes. I just have no idea why this is happening and all attempts to fix this issue have failed (except for turning off instrumenting program flows and turning off code coverage). I even tried setting up a build phase run script that finds and clears the previous code coverage files, but that did not work either.
Has anyone figured this out?
Thanks @gagarwal for the direction. I'll just have to figure out a different jenkins reporting tool since the old code coverage files were needed, but I suppose that isn't supported anymore. Here are some screenshots to illustrate the setup that generates code coverage reports viewable within Xcode based on gagarwal's sugguestions:
----------------------
main app target config
----------------------
----------------------
test app target config
----------------------
------------------------------------------
Scheme config (see "Gather coverage data")
------------------------------------------
Xcode 7's new code coverage features use the LLVM coverage format.
Also Xcode 7 has new build settings for code coverage: "CLANG_ENABLE_CODE_COVERAGE"
Make sure "CLANG_ENABLE_CODE_COVERAGE" is set to "YES" and following to NO:
GCC_GENERATE_TEST_COVERAGE_FILES = NO; GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With