Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6.1 not detecting unit tests until runtime

I ran into an issue with Xcode 6.1.1 not detecting a unit test file. I ran the scheme it was associated with and the file was found at runtime and ended up with an 'rT' icon next to it in the unit test navigator. That led me to this question but none of the answers are working for me. No amount of deleting my derived data or restarting Xcode is helping. The only thing that came close to working was deleting my derived data folder while Xcode was running -- when it reindexed it discovered all of the test files in one of my three schemes.

All these tests had been detected in the past -- I think this all broke during reindexing.

Has anyone seen this and found a solution? I would like my tests to be detected before runtime so I can easily run them individually.

like image 920
Ben Flynn Avatar asked Dec 17 '14 17:12

Ben Flynn


2 Answers

I've run into this too but deleting the Derived Data worked for me:

  1. Close Xcode
  2. Terminal: cd ~/Library/Developer/Xcode/DerivedData/
  3. Terminal: rm -Rf *
  4. Open Xcode and wait for it to re-index the project.

However, you've stated this isn't completely working for you. Perhaps you should also try deleting the Xcode cache directory?

  1. Close Xcode
  2. Terminal: cd ~/Library/Caches/com.apple.dt.Xcode/
  3. Terminal: rm -Rf *
  4. Open Xcode and wait for it to re-index the project.
like image 78
Adam Zielinski Avatar answered Oct 20 '22 23:10

Adam Zielinski


This happened to me on Xcode 7.2 too. I performed the following steps to fix the issue:

  1. I deleted the Derived Data by selecting Window -> Project -> clicking the arrow next to the Derived Data path and deleting all files in the folder.
  2. Quit and relaunched Xcode.

It took some time to index the files and then all the tests appeared under Test navigator.

like image 1
sheona h Avatar answered Oct 20 '22 22:10

sheona h