Пожалуйста, помогите мне в этом сценарии. Я видел несколько сообщений, связанных с этим, но не смог решить проблему, возникающую при запуске XCTestCase.
Я пытаюсь добавить случай XCUnitTest в существующий проект. Во время выполнения теста я сталкиваюсь со следующей проблемой.
Консоль показывает:
Failed to load test bundle from file:///private/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Testƒ.app/PlugIns/Test.xctest: Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/PlugIns/TestTests.xctest/TestTests): no suitable image found. Did find:
/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/PlugIns/Tests.xctest/TestTests: code signature invalid for '/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/PlugIns/Tests.xctest/Tests'
" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/PlugIns/Tests.xctest/Tests, NSDebugDescription=dlopen_preflight(/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/PlugIns/Tests.xctest/Tests): no suitable image found. Did find:
/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/PlugIns/Tests.xctest/Test: code signature invalid for '/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/PlugIns/Tests.xctest/Tests'
, NSBundlePath=/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/PlugIns/Tests.xctest, NSLocalizedDescription=The bundle “Tests” couldn’t be loaded because it is damaged or missing necessary resources.}
libXCTestBundleInject Arguments:
2020-03-30 08:28:13.136091+0100 Test[3588:930021] /var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/Test
2020-03-30 08:28:13.136135+0100 Test[3588:930021] -NSTreatUnknownArgumentsAsOpen
2020-03-30 08:28:13.136163+0100 Test[3588:930021] NO
2020-03-30 08:28:13.140427+0100 Test[3588:930021] -ApplePersistenceIgnoreState
2020-03-30 08:28:13.140485+0100 Test[3588:930021] YES
2020-03-30 08:28:13.140518+0100 Test[3588:930021] libXCTestBundleInject Environment:
2020-03-30 08:28:13.140797+0100 Test[3588:930021] CA_ASSERT_MAIN_THREAD_TRANSACTIONS = 0
2020-03-30 08:28:13.140855+0100 Test[3588:930021] CA_DEBUG_TRANSACTIONS = 0
2020-03-30 08:28:13.140923+0100 Test[3588:930021] XPC_FLAGS = 0x0
2020-03-30 08:28:13.140954+0100 Test[3588:930021] XCInjectBundleInto = /private/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/Test
2020-03-30 08:28:13.140983+0100 Test[3588:930021] DYLD_FRAMEWORK_PATH = /private/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/Frameworks:
2020-03-30 08:28:13.141011+0100 Test[3588:930021] XCTestConfigurationFilePath = /private/var/mobile/Containers/Data/Application/CC15C4BC-599B-4D5A-AEE6-FBF2A3CFAEA1/tmp/TestTests-0F2F6E4A-CB44-476E-8046-C61EB392B443.xctestconfiguration
2020-03-30 08:28:13.141329+0100 Test[3588:930021] MTC_CRASH_ON_REPORT = 1
2020-03-30 08:28:13.141409+0100 Test[3588:930021] SHELL = /bin/sh
2020-03-30 08:28:13.141443+0100 Test[3588:930021] DYLD_LIBRARY_PATH = /private/var/containers/Bundle/Application/E8F3581C-6EC3-4930-AC50-105B5B6A3BD6/Test.app/Frameworks
2020-03-30 08:28:13.141494+0100 Test[3588:930021] SQLITE_ENABLE_THREAD_ASSERTIONS = 1
2020-03-30 08:28:13.141562+0100 Test[3588:930021] CLASSIC = 0
2020-03-30 08:28:13.141610+0100 Test[3588:930021] NSUnbufferedIO = YES
2020-03-30 08:28:13.141659+0100 Test[3588:930021] OS_ACTIVITY_DT_MODE = YES
2020-03-30 08:28:13.141708+0100 Test[3588:930021] PATH = /usr/bin:/bin:/usr/sbin:/sbin
2020-03-30 08:28:13.141740+0100 Test[3588:930021] CFFIXED_USER_HOME = /private/var/mobile/Containers/Data/Application/CC15C4BC-599B-4D5A-AEE6-FBF2A3CFAEA1
2020-03-30 08:28:13.141791+0100 Test[3588:930021] HOME = /private/var/mobile/Containers/Data/Application/CC15C4BC-599B-4D5A-AEE6-FBF2A3CFAEA1
2020-03-30 08:28:13.142947+0100 Test[3588:930021] TMPDIR = /private/var/mobile/Containers/Data/Application/CC15C4BC-599B-4D5A-AEE6-FBF2A3CFAEA1/tmp/
2020-03-30 08:28:13.143044+0100 Test[3588:930021] USER = mobile
2020-03-30 08:28:13.143075+0100 Test[3588:930021] XPC_SERVICE_NAME = UIKitApplication:com.btor.Test[0xca1c][60]
2020-03-30 08:28:13.143142+0100 Test[3588:930021] LOGNAME = mobile
2020-03-30 08:28:13.143170+0100 Test[3588:930021] __CF_USER_TEXT_ENCODING = 0x1F5:0:0