0

I have create simple demo project for getting code coverage whine I run in Xcode I am getting this coverage. look in to image

enter image description here

But when I run from command using terminal I can't show code coverage

xcodebuild -scheme Mock -destination 'platform=iOS Simulator,name=iPhone X,OS=11.1' -enableCodeCoverage YES -derivedDataPath . clean build test

After create report I am using this

xcrun llvm-cov report -instr-profile=/Users/nikhil.makwana/Downloads/Mock/Build/ProfileData/70053ED1-6A92-49BB-B445-A16CF615C615/Coverage.profdata  /Users/nikhil.makwana/Downloads/Mock/Build/Products/Debug-iphonesimulator/Mock.app   >  jikstest.report

where is the problem here?

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
jignesh Vadadoriya
  • 3,244
  • 3
  • 18
  • 29

1 Answers1

2

This questioned was asked a long time ago. But I ran into this issue and found that you need to point to the actual file Mock inside the folder Mock.app. Here is the answer:

xcrun llvm-cov report -instr-profile=/Users/nikhil.makwana/Downloads/Mock/Build/ProfileData/70053ED1-6A92-49BB-B445-A16CF615C615/Coverage.profdata  /Users/nikhil.makwana/Downloads/Mock/Build/Products/Debug-iphonesimulator/Mock.app/Mock   >  jikstest.report
Sam
  • 36
  • 3