我有一个CocoaPod,它使用XCTest框架。为了将XCTest导入到pod中,我将s.frameworks = 'XCTest'添加到.podspec文件中。
现在我可以将XCTest导入到pod类中,但是当尝试运行示例项目时,我会得到以下错误:
dyld:未加载的库:@rpath/XCTest.framework/XCTest 参考来源: /Developer/CoreSimulator/Devices/DEVICE_UUID/data/Containers/Bundle/Application/ID/TestPod_Example.app/Frameworks/TestPod.framework/TestPod 原因:找不到图像
发布于 2017-05-04 09:10:25
找到了一个解决方案,当在XCTest podspec中添加框架时,请确保将它添加到您的UITesting中,并且只在Podfile中测试目标。这是因为XCTest不能在开发的目标上运行,只能在测试目标上运行。
在Podfile中
target 'MyProjectTestTarget' do
pod 'PodFramework that includes XCTest as a dependency'
endhttps://stackoverflow.com/questions/43778110
复制相似问题