IPhone unit test communication problem, can not find DevToolsBundleInjection.framework

I am trying to configure application unit tests for my iphone application. So I made a copy of the target application and the unit test target as described in the Apple documentation ( http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/135-Unit_Testing_Applications/unit_testing_applications.html )

Following Apple’s instructions, I couldn’t refer to my classes in unit tests, so I linked the application to the unit test package using the “Bundle Loader” build setting and set the main purpose for exporting characters. This resolved compile-time errors, and it worked and ran my tests immediately after changing it. But as soon as I cleaned up and built again, I started getting this error when I tried to run on the device:

Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1 (7C144)/Symbols/Developer/Library/PrivateFrameworks/DevToolsBundleInjection.framework/DevToolsBundleInjection" (file not found). 

It is true that the file does not exist. I found the .framework file in the section: / Xcode 3.1.4 / Library / PrivateFrameworks PrivateFrameworks

and made a symbolic link. Then the launch of the application said that it could not link the application files:

 010-01-25 20:19:22.330 SmokeyTheBear[5808:207] Error loading /private/var/mobile/Applications/26E1F8F4-6444-415B-84CB-BB161DBA29E9/SmokeyTheBear.app/LogicTests.octest/LogicTests: dlopen(/private/var/mobile/Applications/26E1F8F4-6444-415B-84CB-BB161DBA29E9/SmokeyTheBear.app/LogicTests.octest/LogicTests, 262): Symbol not found: _OBJC_CLASS_$_AppDelegate Referenced from: /private/var/mobile/Applications/26E1F8F4-6444-415B-84CB-BB161DBA29E9/SmokeyTheBear.app/LogicTests.octest/LogicTests Expected in: /var/mobile/Applications/26E1F8F4-6444-415B-84CB-BB161DBA29E9/SmokeyTheBear.app/UDorse in /private/var/mobile/Applications/26E1F8F4-6444-415B-84CB-BB161DBA29E9/SmokeyTheBear.app/LogicTests.octest/LogicTests DevToolsBundleInjection: Error loading bundle '/private/var/mobile/Applications/26E1F8F4-6444-415B-84CB-BB161DBA29E9/SmokeyTheBear.app/LogicTests.octest' 

Then I turned on the normal target for the application again, and it ran all my unit tests and exited! I cleaned up and built again, and then the normal target ran normally. The unit test target still does not work.

+4
source share
3 answers

Check the build parameters for the target project goal.

Find the setting "Symbols hidden by default."

Make sure it is set to NO , at least to build debugging, which you should use for testing.

Without this setting (which can be migrated from older Xcode projects), the test code will not automatically reference the project code.

+1
source

How do you connect the structure in the first place? You do not need to create a symbolic link to make it work. Go to the target set of test packages and open Project-> Edit Active Target. Verify that the library is located in the "Associated Libraries" section of the general tab. If so, delete / re-add it. This fixes similar library binding issues for me.

0
source

Hey smokey_the_bear, you checked what I experienced with this question:

Linker Error: iPhone Unit Test Linking to Application Class Links

I want to specify a package loader to display links correctly.

0
source

Source: https://habr.com/ru/post/1299400/


All Articles