title: xcrun llvm-cov show: No coverage data found
body: <p>What are the possible reasons for xcrun llvm-cov show command to return error: Failed to load coverage: No such file or directory?</p>
  <p>I have an iOS lib.
  The result of the lib build is *.a binary file.
  I have a scheme in the project which also contains GTest unit tests.</p>
  <p>So I execute:</p>
  <pre><code>xcodebuild test \
  -sdk iphonesimulator \
  -destination &quot;$DESTINATION&quot; \
  -derivedDataPath &quot;$ROOT&quot;/DerivedData \
  -scheme unitTestsTarget \
  -project &quot;$ROOT&quot;/libProject.xcodeproj \
  -enableCodeCoverage YES
  </code></pre>
  <p>After that</p>
  <pre><code>xcrun llvm-profdata merge .../Coverage.profdata .../EA8FF09E-3BFE-42D2-BFA7-A39D69E7F688-45921.profraw -output ./merged.profdata
  </code></pre>
  <p>And</p>
  <pre><code>xcrun llvm-cov show -format=html -use-color=true -output-dir=./coverage-html -instr-profile ./merged.profdata -object ./DerivedData/Build/Products/Debug-iphonesimulator/myLib.a -ignore-filename-regex='\''.*\.h'\'''
  </code></pre>
  <p>And the last command gives me</p>
  <pre><code>error: ./myLib.a: Failed to load coverage: No such file or directory
  </code></pre>
  <p>I have 3 modules of a similar structure and one of them works fine and the other 2 give me this error.</p>
  <p>I'd really appreciate is someone can give a hint on the possible reasons for this error and possible solutions to try.</p>