Add cocoapods to tests target too? [duplicate]

↘锁芯ラ 提交于 2019-12-17 10:39:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!