【问题标题】:Cannot run tests on Xcode 6 Beta 5无法在 Xcode 6 Beta 5 上运行测试
【发布时间】:2014-10-18 18:02:55
【问题描述】:

我有一个使用 Kiwi 测试框架的 iOS 项目(我从 cocoapods 安装的最新版本 2.3.0)。 起初,当我运行测试时,我收到一个错误,它找不到 XCTest.h。 所以我按照这个答案的建议:https://stackoverflow.com/a/24651704/1082326,问题就消失了。

但是出现了一个不同的问题,现在当我在选择的模拟器为“iPhone 5 (8.0)”时尝试运行测试时,我收到以下错误:

IDEBundleInjection.c: Error 3587 loading bundle
'/Users/ifeins/Library/Developer/Xcode/DerivedData/teacup-
aaenoytmfpqpgmaebqotyfrutlxy/Build/Products/Debug-iphonesimulator/teacup-tests.octest': 
The bundle “teacup-tests.octest” couldn’t be loaded because it is damaged or missing 
necessary resources.
DevToolsBundleInjection environment:
XCInjectDiagnostics: (null)
XCInjectBundleInto: /Users/ifeins/Library/Developer/Xcode/DerivedData/teacup- 
aaenoytmfpqpgmaebqotyfrutlxy/Build/Products/Debug-iphonesimulator/valet.app/valet
XCInjectBundle: /Users/ifeins/Library/Developer/Xcode/DerivedData/teacup-
aaenoytmfpqpgmaebqotyfrutlxy/Build/Products/Debug-iphonesimulator/teacup-tests.octest
TestBundleLocation: /Users/ifeins/Library/Developer/Xcode/DerivedData/teacup-
aaenoytmfpqpgmaebqotyfrutlxy/Build/Products/Debug-iphonesimulator/teacup-tests.octest
TMPDIR: /Users/ifeins/Library/Developer/CoreSimulator/Devices/BC59F7AC-9D3E-4FFC-9726-
97911AA597A6/data/Containers/Data/Application/E1D4A3F0-C06B-485D-BF87-9F5EA70D974A/tmp
DYLD_LIBRARY_PATH: /Users/ifeins/Library/Developer/Xcode/DerivedData/teacup-
aaenoytmfpqpgmaebqotyfrutlxy/Build/Products/Debug-iphonesimulator
DYLD_INSERT_LIBRARIES: /Applications/Xcode6-Beta5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFra
meworks/IDEBundleInjection.framework/IDEBundleInjection
DYLD_FRAMEWORK_PATH: /Users/ifeins/Library/Developer/Xcode/DerivedData/teacup-
aaenoytmfpqpgmaebqotyfrutlxy/Build/Products/Debug-iphonesimulator
DYLD_FALLBACK_LIBRARY_PATH: /Applications/Xcode6-Beta5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulat
or8.0.sdk/usr/lib
DYLD_FALLBACK_FRAMEWORK_PATH: /Applications/Xcode6-Beta5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/Developer/Library/Frameworks

你知道可能是什么问题吗?

提前致谢, 伊多

【问题讨论】:

    标签: ios testing xcode6 kiwi


    【解决方案1】:

    看看:https://stackoverflow.com/a/22024428/529243https://stackoverflow.com/a/22056161/529243

    我遇到了同样的错误,在完成这些步骤后问题就消失了。

    【讨论】:

      【解决方案2】:

      使用 XCTest 转换向导:

      Edit > Refactor > Convert to XCTest
      

      【讨论】:

        【解决方案3】:

        我从 github 找到了一个解决方案:https://github.com/kiwi-bdd/Kiwi/issues/570 (感谢 tjarratt @https://github.com/tjarratt

        将测试包的“包装器扩展”从 octest 更改为 xctest。

        【讨论】:

          【解决方案4】:

          我已经通过将代码签名设置为“不要代码签名”并清理项目(Cmd + Option + Shift + K)解决了这个问题。

          【讨论】:

            【解决方案5】:

            我最近遇到了这个问题,我发现我已经将一个新的 XCTest 添加到一个专门用于我们旧的 OCTest 剩余类的目标中。只是分享以防将来对任何人有所帮助。

            【讨论】:

              猜你喜欢
              • 2014-10-10
              • 1970-01-01
              • 1970-01-01
              • 2015-01-30
              • 2016-12-29
              • 1970-01-01
              • 2014-11-03
              • 1970-01-01
              • 2013-11-26
              相关资源
              最近更新 更多