ios - 代码覆盖率数据生成失败

标签 ios xcode

当我用 slather 运行我的测试项目时,我得到了这个日志 有人有解决办法吗?

2015-12-14 14:39:29.483 xctest[7880:987585] The bundle “Famima_StampTests.xctest” couldn’t be loaded. Try reinstalling the bundle. 2015-12-14 14:39:29.484 xctest[7880:987585] (dlopen(/Users/wx/Library/Developer/Xcode/DerivedData/Famima_Stamp-akiykixzlljhyegfebcgflamfzgb/Build/Intermediates/CodeCoverage/Famima_Stamp/Products/Debug-iphonesimulator/Famima_StampTests.xctest/Famima_StampTests, 265): Symbol not found: _OBJC_CLASS_$_AgreementViewController
Referenced from: /Users/wx/Library/Developer/Xcode/DerivedData/Famima_Stamp-akiykixzlljhyegfebcgflamfzgb/Build/Intermediates/CodeCoverage/Famima_Stamp/Products/Debug-iphonesimulator/Famima_StampTests.xctest/Famima_StampTests Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/xctest in /Users/wx/Library/Developer/Xcode/DerivedData/Famima_Stamp-akiykixzlljhyegfebcgflamfzgb/Build/Intermediates/CodeCoverage/Famima_Stamp/Products/Debug-iphonesimulator/Famima_StampTests.xctest/Famima_StampTests) Program ended with exit code: 83

最佳答案

我解决了这个问题,就像我解决了大部分 XCode 问题一样:

  1. 删除 DerivedData 中的项目文件(Xcode>Preferences>Locations>DerivedData→ 在 finder 中跳转到那里)
  2. 产品>清洁
  3. (按住 alt 键)Product>Clean Build Folder
  4. 退出 XCode
  5. 重启 XCode
  6. 从您的设备/模拟器中删除您的应用

再试一次。 如果它仍然不起作用,请使用另一个模拟器/设备运行几次。迟早它会在原来的那个上再次工作。

关于ios - 代码覆盖率数据生成失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34261133/

相关文章:

ios - UITableView prepareForSegue 没有推送到 UIWebView

ios - 如何读取healthKit心率数据?

ios - iOS Parse框架和Facebook clientKey

ios - 如何检查iOS设备中是否安装了应用程序?

objective-c - 如何在 XCode 文件中查找符号?

ios - Xcode10 无法构建和运行 React Native

ios - CNContactViewController导航条各版本不同

ios - 按特定字符划分 NSString

ios - 如何在 xCode 中访问 iphone 锁屏和主屏幕图像?

xcode - Xcode无法识别C++语法