Xcode 7 Code Coverage: how to see specific lines

How can I see which lines were exercised by my tests?

Replies

Open the report navigator. Select the test from the report navigator.


Click the Coverage button at the top of the editor. You should see a list of your app's source code files in the editor. If not, click the disclosure triangle next to your app target to see the list of files.


If you move the mouse cursor over one of the source code files in the list, a small button with an arrow pointing right will appear. Click that button to open the file in the editor. On the right side of the editor is a number that shows the number of times the line was exercised in your tests. Code that was not exercised will be highlighted in the editor.

Did you notice that the numbers on the right hand "gutter" (the numbers representing how mnay times each line was fired) seem to dissapear?

fyi, I dig your last name.

My last name, Superczynski, only has a single zy occurrence.

The numbers do not disappear for me, even days after running the tests.


If you see no code coverage data on the right side of the editor, choose Editor > Show Code Coverage in Xcode.

It's an easier username to reserve than my first name, Mark.