【发布时间】:2016-02-26 01:49:43
【问题描述】:
尝试在我的设备上运行 UI 测试时出现错误:
XCTRunner[1476:104021] 无法加载包“AppUITests” 因为它已损坏或缺少必要的资源。尝试重新安装 捆绑。 2015-11-23 20:58:53.903 XCTRunner[1476:104021] (dlopen_preflight(/var/mobile/Containers/Bundle/Application/FAC2EFB2-92C6-4668-96A7-C77CC5C4AE87/AppUITests-Runner.app/PlugIns/AppUITests.xctest/TrueMostUITests): 未加载库:@rpath/UIColor_Hex_Swift.framework/UIColor_Hex_Swift 引用自:/var/mobile/Containers/Bundle/Application/FAC2EFB2-92C6-4668-96A7-C77CC5C4AE87/AppUITests-Runner.app/PlugIns/AppUITests.xctest/AppUITests 原因:图片未找到)
在这种情况下,它是“UIColor_Hex_Swift.framework”,它位于我的 podfile 中。但我从 cocoapods 加载哪些框架并不重要。它会在每个框架上失败。
我尝试过更改 pod 文件、清理、删除派生数据、重新安装 pod 和更改签名。不,我没有想法。
如果我使用模拟器,一切正常。
这是我的 pod 文件:
platform :ios, '9.0'
workspace './AppWorkspace'
use_frameworks!
inhibit_all_warnings!
link_with 'App', 'AppTests', 'AppUITests'
target 'App', :exclusive => false do
pod 'SwiftyJSON', '~> 2.3.0'
pod 'MQTTKit', :git => 'https://github.com/mobile-web-messaging/MQTTKit.git'
pod 'PromiseKit', '~> 3.0.0'
pod 'UIColor_Hex_Swift',:git => 'https://github.com/yeahdongcn/UIColor-Hex-Swift.git', :branch => 'Swift-2.0'
pod 'OHHTTPStubs', '~> 4.3.0'
pod 'Alamofire', '~> 3.1.0'
end
def testing_pods()
# pod 'SwiftyJSON', '~> 2.3.0'
# pod 'MQTTKit', :git => 'https://github.com/mobile-web-messaging/MQTTKit.git'
# pod 'PromiseKit', '~> 3.0.0'
pod 'UIColor_Hex_Swift',:git => 'https://github.com/yeahdongcn/UIColor-Hex-Swift.git', :branch => 'Swift-2.0'
# pod 'OHHTTPStubs', '~> 4.3.0'
# pod 'Alamofire', '~> 3.1.0'
end
target 'AppTests', :exclusive => false do
testing_pods
end
target 'AppUITests', :exclusive => false do
testing_pods
end
【问题讨论】:
-
您找到解决方案了吗?
标签: ios xcode xctest xcode-ui-testing