Ios 运行Xcode测试时未找到FBSnapshotTestCase映像

Ios 运行Xcode测试时未找到FBSnapshotTestCase映像,ios,xcode,xctest,fbsnapshottestcase,Ios,Xcode,Xctest,Fbsnapshottestcase,无法找出运行Xcode测试时未找到reportFBSnapshotTestCase映像的原因 我试图在TargetChartTests中链接FBSnapshotTestCase,但仍然看到相同的错误 我不熟悉这个,有人能帮忙吗?先谢谢你 复制: 从下载项目 导航到项目根目录 (可选)运行carthage bootstrap以安装依赖项。项目有一个依赖项检查,因此如果您不运行它,它将在启动测试时运行它 进入 xcodebuild-project'Charts.xcodeproj'-scheme'C

无法找出运行Xcode测试时未找到report
FBSnapshotTestCase映像的原因

我试图在Target
ChartTests
中链接
FBSnapshotTestCase
,但仍然看到相同的错误

我不熟悉这个,有人能帮忙吗?先谢谢你

复制:

从下载项目

导航到项目根目录

  • (可选)运行
    carthage bootstrap
    以安装依赖项。项目有一个依赖项检查,因此如果您不运行它,它将在启动测试时运行它

  • 进入

    xcodebuild-project'Charts.xcodeproj'-scheme'ChartsTests'-configuration'Debug'-sdk iphonesimulator-destination id='E40B5365-EF82-430D-A767-2A37995CCEE1'干净构建测试

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

    然后报告:

    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 **
    

    事实证明,我需要在构建阶段添加运行脚本,并让迦太基复制框架:

    复制自:

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

    /usr/local/bin/carthage copy-frameworks
    
    并在“输入文件”下添加要使用的框架的路径,例如:

    $(SRCROOT)/Carthage/Build/iOS/FBSnapshotTestCase.framework