ios - 使用 Xcode 进行逻辑单元测试 - DerivedData 为空

标签 ios xcode unit-testing cocoapods xctest

我正在为我们现有的应用编写一些逻辑单元测试。当我运行一个测试用例时,我得到了,

ld: warning: directory not found for option '-L/Users/chinthaka/Library/Developer/Xcode/DerivedData/XXXXX-cuqxyxigigmngzcvxbguttpluqva/Build/Products/Debug-iphonesimulator/AFNetworking' ld: library not found for -lAFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)

然后我检查了 DerivedData 目录,它只包含 XXXXXUnitTests.xctest 文件。

enter image description here

其他链接器标志包含 -ObjC 和 -l(AFNetworking)。

框架搜索路径如附件图片所示,它也包含一些 pod。 (但 AFNetworking 不在其中。)

enter image description here

库搜索路径是这样的,

enter image description here

还有什么我错过检查或配置的吗?请帮忙。

最佳答案

将测试目标的“仅构建事件架构”设置设置为否后,我能够解决此问题。

此外,iOS Development Target 是 iOS 9.3,它必须是 iOS 8.0。

关于ios - 使用 Xcode 进行逻辑单元测试 - DerivedData 为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40363929/

相关文章:

ios - 在 iOS 8 Beta 5 中使用 Swift 播放系统声音

ios - 是否可以在设备启动时启动 iOS 应用程序?

ios - 警告 : expression implicitly coerced from 'String?' to Any

java - 使用不带参数的 Junit 进行单元测试

java - 使用 Mockito 模拟枚举?

c++ - 我如何从终端的谷歌测试套件中获取 C++ 代码超量?

iphone - 使用用户 token 、rest/rails 和钥匙串(keychain)帮助进行 iOS 身份验证

ios - 带有 swift 3 和 Alamofire 的 JSON 字符串上的 Unicode 字符

ios - Jenkins 构建失败: Xcode couldn't find a provisioning profile matching

ios - 仅以英文获取用户的城市