user2924482
user2924482

Reputation: 9120

Xcode: code coverage percentage

Any of you knows how can I get percentage of code coverage in Xcode?. Right now I only see the bars:

enter image description here

I'll really appreciate your help.

Upvotes: 12

Views: 5297

Answers (5)

Genki
Genki

Reputation: 3195

Also, make sure to have "Gather coverage for" is enabled in the edit scheme:

enter image description here

Upvotes: 1

joshbillions
joshbillions

Reputation: 1059

Just some clarification on where to find these numbers in Xcode 10:

  1. Run your tests and navigate to the Test navigator
  2. Right click on the test and select "Jump to Report"

enter image description here

  1. Next to your target you should see "Test", right click on that, then select "Coverage" enter image description here
  2. Test Coverage info is then shown

enter image description here

Upvotes: 3

Jeremiah
Jeremiah

Reputation: 1461

For anyone coming across this question the percentage is show in Xcode now (currently 9.3).

coverage

Upvotes: 0

VillyG
VillyG

Reputation: 155

Hover over on top of the first row with the .app. It will tell you the calculated percentage

Upvotes: 3

Jens Meder
Jens Meder

Reputation: 4367

Unfortunately, the code coverage overview in Xcode is really bad. If you do not use Xcode server to test your projects the only way to obtain the percentage is by mouse over each bar.

enter image description here

If you use Xcode server you will see the percentage for every device type in a table.

Upvotes: 13

Related Questions