40

My Xcode 5 Product -> Test is grayed out but I can still run my unit tests directly by clicking play from the Test Navigator.

Any idea what's causing Product -> Test to gray out?

enter image description here

Boon
  • 40,656
  • 60
  • 209
  • 315

2 Answers2

113

For me, the issue was that my scheme didn't have the test project listed. Go to Product->Scheme->Edit Scheme then choose Test on the left, and add the tests to this scheme.enter image description here

spfursich
  • 5,045
  • 3
  • 21
  • 24
  • Nice! My tests used to work for me. I'm not sure what changed, but it's working again. Thanks. – Mike Taverne Mar 22 '16 at 23:48
  • I had the same issue. An xCode 9.4.1 close and re-open worked. – rustyMagnet Jul 09 '18 at 14:56
  • 1
    yeah, adding a user friendly alert like, "You don't have any tests configured, try editing your scheme"... just isn't Apple's style any more :( All it does when you Command-U is "beep"... very helpful – Paul Stevenson Jan 13 '20 at 00:12
36

It's because the Scheme is incorrectly configured (for the Test action). Set the test target and check those checkboxes.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • In my case, I actually have two schemes with similar configuration. One scheme would show Test and another wouldn't. I deleted the latter one. – Boon May 28 '14 at 13:49