How to add XCTest to Cocoa Touch Framework

Hi everyone!

If you need to create Cocoa Touch Framework with XCTest follow the steps below:

  1. Create new Cocoa Touch Framework.
  2. Add to ProjectName.h following import:
    #import <XCTest/XCTest.h>
  3. Add XCTest.framework to project
    • Go to Taggets -> General
    • Click to Linked Frameworks and Libraries
    • Click plus
    • Type xctest in search field
    • Select XCTest.framework 
    • Click add
    • Make sure selected framework has been appeared in Linked Frameworks and Libraries list in other case repeat all steps under step 3
    • Framework status should be as Required
  4. Add $(PLATFORM_DIR)/Developer/Library/Frameworks to Framework Search Path
    • Go to Build Settings
    • Type search in the search field
    • Expand Search Paths
    • Expand Framework Search Paths
    • Add $(PLATFORM_DIR)/Developer/Library/Frameworks to Debug and Release
      • Click to plus
      • Type $(PLATFORM_DIR)/Developer/Library/Frameworks inside Any Architecture | Any SDK and press Enter

​​That's all!