首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行Xcode测试时找不到FBSnapshotTestCase映像

运行Xcode测试时找不到FBSnapshotTestCase映像
EN

Stack Overflow用户
提问于 2017-04-21 01:44:12
回答 1查看 641关注 0票数 0

不知道为什么报告FBSnapshotTestCase image not found while running Xcode test

我试图将FBSnapshotTestCase链接到目标ChartTests中,但仍然看到了相同的错误。

我对此不熟悉,有人能帮忙吗?提前谢谢。

复制:

https://github.com/danielgindi/Charts下载该项目

导航到项目根目录,

  1. (可选)运行carthage bootstrap安装依赖项。该项目有一个依赖项检查,所以如果您不运行它,它将在启动测试时运行它。
  2. 输入 -project 'Charts.xcodeproj‘-scheme 'ChartsTests’-configuration 'Debug‘-sdk iphone仿真器-destination id=’E40B5365-EF82-430 d-A767-2A37995CCEE1‘清洁构建测试

目标id可以是机器上模拟器的任何uuid。

然后报告说:

代码语言:javascript
复制
2017-04-20 13:47:57.611 xctest[90924:13099756] The bundle “ChartsTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2017-04-20 13:47:57.611 xctest[90924:13099756] (dlopen_preflight(/Users/user/Library/Developer/Xcode/DerivedData/Charts-ambsdrskvocwekcmoobyhanaiixm/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ChartsTests.xctest/ChartsTests): Library not loaded: @rpath/FBSnapshotTestCase.framework/FBSnapshotTestCase
  Referenced from: /Users/user/Library/Developer/Xcode/DerivedData/Charts-ambsdrskvocwekcmoobyhanaiixm/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ChartsTests.xctest/ChartsTests
  Reason: image not found)
2017-04-20 13:47:57.625 xcodebuild[90311:13086990] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

Testing failed:
    Test target ChartsTests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **
EN

回答 1

Stack Overflow用户

发布于 2017-04-21 06:47:06

结果,我需要在构建阶段添加运行脚本,并让carthage复制框架:

https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos复制

在应用程序目标的“构建阶段”设置选项卡上,单击“+”图标并选择“新建运行脚本阶段”。创建一个运行脚本,在其中指定shell (ex: /bin/sh),将以下内容添加到shell下面的脚本区域:

代码语言:javascript
复制
/usr/local/bin/carthage copy-frameworks

并将路径添加到您希望在“输入文件”下使用的框架中,例如:

代码语言:javascript
复制
$(SRCROOT)/Carthage/Build/iOS/FBSnapshotTestCase.framework
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43532547

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档