我正在尝试在我的 XCTest UI 自动化中使用测试框架SBTUITestTunnel 。我按照描述设置了 Podfile:
target 'MyApp' do
pod 'SBTUITestTunnel/Server', '3.0.2'
end
target 'MyAppUITests' do
pod 'SBTUITestTunnel/Client', '3.0.2'
end
但是,当我运行 UI 测试时,它们在启动后立即崩溃:
2018-03-06 17:19:01.140 MyAppUITests-Runner[64387:8057955] Running tests...
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
* frame #0: 0x000000010944ba19 libsystem_trace.dylib`_os_trace_image_was_unloaded + 244
frame #1: 0x000000010485088a dyld_sim`dyld::removeImage(ImageLoader*) + 343
frame #2: 0x000000010485378a dyld_sim`dyld::garbageCollectImages() + 735
frame #3: 0x0000000104857c5c dyld_sim`dlopen + 924
frame #4: 0x00000001091ccd25 libdyld.dylib`dlopen + 59
frame #5: 0x00000001054981c8 CoreFoundation`_CFBundleDlfcnLoadBundle + 152
frame #6: 0x000000010549804f CoreFoundation`_CFBundleLoadExecutableAndReturnError + 335
frame #7: 0x0000000104a363b5 Foundation`-[NSBundle loadAndReturnError:] + 547
frame #8: 0x0000000104937127 XCTest`_XCTestMain + 514
frame #9: 0x000000010548ab5c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
frame #10: 0x000000010546fe54 CoreFoundation`__CFRunLoopDoBlocks + 356
frame #11: 0x000000010546f5ee CoreFoundation`__CFRunLoopRun + 894
frame #12: 0x000000010546f016 CoreFoundation`CFRunLoopRunSpecific + 406
frame #13: 0x0000000107d8ea24 GraphicsServices`GSEventRunModal + 62
frame #14: 0x0000000105908134 UIKit`UIApplicationMain + 159
frame #15: 0x0000000104845838 MyAppUITests-Runner`___lldb_unnamed_symbol8$$MyAppUITests-Runner + 42
frame #16: 0x00000001091cf65d libdyld.dylib`start + 1
谁能帮我调试一下?我什至不能设置断点,所以我很茫然。请记住我的代码构建并开始执行。我猜我的 Podfile 或我的项目配置有问题。我尝试了他们对未找到框架的建议,但没有帮助:
如果您使用的是 CocoaPods v1.0 并且您的 UI 测试无法启动,您可能需要在 UI 测试目标的构建设置中将 $(FRAMEWORK_SEARCH_PATHS) 添加到您的运行路径搜索路径!