• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 无法初始化测试包 xcode 单元测试

[复制链接]
菜鸟教程小白 发表于 2022-12-13 04:35:28 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

当我尝试运行单元测试时,我在 Xcode 9.1 中遇到了这个故障。完整的错误日志如下:


2018-08-20 14:15:23.907432+0800 module-Core-TestHost[58581:15107793] Unable to initialize test bundle from file:///Users/russell/finder/sdk/dev/module/ios/Build/Products/Debug_MemoryGuard-iphonesimulator/module-Core-TestHost.app/PlugIns/module-Core-UnitTest.xctest/
    2018-08-20 14:15:23.911047+0800 module-Core-TestHost[58581:15107793] IDEBundleInjection Arguments: (
        "/Users/russell/Library/Developer/CoreSimulator/Devices/CD5368D2-AB15-4349-81DB-C8B96EB74272/data/Containers/Bundle/Application/3DE8BB53-4825-41FC-8F1C-6299B0C37BE8/module-Core-TestHost.app/module-Core-TestHost",
        "-NSTreatUnknownArgumentsAsOpen",
        NO,
        "-ApplePersistenceIgnoreState",
        YES
    )
    2018-08-20 14:15:23.913488+0800 module-Core-TestHost[58581:15107793] IDEBundleInjection Environment: {
        "CFFIXED_USER_HOME" = "/Users/russell/Library/Developer/CoreSimulator/Devices/CD5368D2-AB15-4349-81DB-C8B96EB74272/data/Containers/Data/Application/81029121-53FF-4C7D-8689-1B8A43D5B172";
        CLASSIC = 0;
        "CUPS_SERVER" = "/private/tmp/com.apple.launchd.J5oMC8Wk3T/Listeners";
        "DYLD_FALLBACK_FRAMEWORK_PATH" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks";
        "DYLD_FALLBACK_LIBRARY_PATH" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib";
        "DYLD_FRAMEWORK_PATH" = "/Users/russell/finder/sdk/dev/module/ios/Build/Products/Debug_MemoryGuard-

---

**Unable to initialize test bundle from file:///Users/russell/finder/sdk/dev/module/ios/Build/Products/Debug_MemoryGuard-iphonesimulator/module-Core-TestHost.app/PlugIns/module-Core-UnitTest.xctest/**

有人知道这个错误吗?谢谢!



Best Answer-推荐答案


经过几个小时的研究,我终于通过以下步骤解决了我的问题:

从 Xcode,文件 -> 工作区设置... -> 高级... -> 构建位置 strong>(选择“唯一”选项)

原因是 Xcode 构建中间文件不在正确的路径中。通过选择上述选项,所有这些文件都进入了正确的目录,我的问题得到了解决。

关于ios - 无法初始化测试包 xcode 单元测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51925684/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap