问题
I have default project template with tests and cocoapods installed (pod install
). Pods works fine with main target, but when I try to import something in tests, I get something like
Time.m:11:9: 'NSDate-Utilities.h' file not found
Does this mean that I should add pods directory to header search path in tests target? Can this be done via cocoapods CLI automatically somehow?
That question by suggested link had WRONG answer until yesterday.
回答1:
Ok, there is a simple solution, see answer above to get this working automatically. I had to select Pods/Pods
configuration file for tests target in project info.

回答2:
What you want to use is link_with from your Podfile
. Something like:
link_with 'MainTarget', 'MainTargetTests'
Then run pod install
again.
来源:https://stackoverflow.com/questions/17850261/add-cocoapods-to-tests-target-too