Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I enable code coverage in Xcode 14.3? (It appears different from other versions)

Normally I would follow these steps. Basically I woult tap on my scheme, then edit, then Test, then I'd have a nice neat enable code coverage box I can tick. However, with 14.3, I don't see the info | options etc tabs, instead I see this view. And enable code coverage isn't there. Usually, it would be between Build configuration and Debugger.

14.3

enter image description here

Old view: enter image description here

I don't see show code coverage here either:

enter image description here

like image 600
ScottyBlades Avatar asked Sep 13 '25 16:09

ScottyBlades


2 Answers

Enabling Code Coverage has moved to Test Plan configuration which is designed to manage your tests and was introduced in Xcode 11 at WWDC 2019.

Do the following steps to enable it:

  1. Press Command + Option + u to bring the Edit Scheme window

enter image description here

  1. Hover over the Autocreated test plan to show the disclosure button and click it.

enter image description here

  1. Go to the Configuration tab :

    enter image description here

  2. Find Code Coverage and enable it :

enter image description here

like image 103
Mehdi Ijadnazar Avatar answered Sep 16 '25 09:09

Mehdi Ijadnazar


You can enable it on the test plans configuration. Go to the Test navigator. Click on the "Test Plan" dropdown and then select "Edit test plan"

enter image description here

You will be able to update the shared configs of your test plans, including conde coverage enabling: enter image description here

like image 30
DeluxeAlonso Avatar answered Sep 16 '25 08:09

DeluxeAlonso