7

In OS X 10.9.5 i upgraded from Xcode 5.1.1 to Xcode 6.0.1 (via the App Store). Now in my project XCTest.framework and MyAppTests.xctest are displayed in red letters:

XCTest.framework in red

Still the tests seem to run without problem. What does the red color mean, how can i fix the problem?

Note: I did see this question, but as it is not related to an Xcode upgrade it describes only a similar symptom but it may have a different cause and solution.

Community
  • 1
  • 1
MartinW
  • 4,966
  • 2
  • 24
  • 60

1 Answers1

9

Red letters mean Xcode cannot find the corresponding file in the filesystem.

Why is XCTest.framework displayed in red?

The framework does not reside in the same location in Xcode 6.0.1 as it used to in Xcode 5.1.1
It has moved from:

/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework 

to:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework

Why is the MyAppTests.xctest product displayed in red?

I created a separate Test Configuration in Xcode in order to avoid sandboxing problems as described here: http://marcschwieterman.com/blog/testing-in-the-sandbox/ . As a result, tests get built in their own location and no longer in the debug location as before. But the location of the MYAppTests.xctest product is not automatically updated by Xcode, nor could i find a way to update it manually to the new location.

MartinW
  • 4,966
  • 2
  • 24
  • 60
  • To update it manually to new location, simply click on XCTest.framework -> show utilities panel -> click on file inspector -> click on folder icon on the right side of location section -> choose the new location. – David Liu Jan 16 '16 at 04:36
  • 1
    This is correct for XCTest.framework, but it does not work with MYAppTests.xctest. In this case the folder icon is grayed out and it is not possible to change it's location. – MartinW Jan 17 '16 at 10:45
  • I think for the product, you can try to build on physical device, if should remove this issue. – David Liu Jan 18 '16 at 16:15
  • @DavidLiu I tried that on XCode 7 and it still remains red. Like the OP said, everything works, just stays red though – stonedauwg Jun 24 '16 at 15:23