Running tests on Xcode 6 and device

I am trying to run unit tests on Xcode 6 if I run them on simulator (and 7.1 on that) they work fine

other conditions give this message:

2014-10-10 01:39:56.190 MyApp[493:173988] Error loading    
/private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605- 
FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests:  
dlopen(/private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605-
FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests, 262): no suitable image found.  
    Did find:

/private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605-
FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests: mmap() error 1 at address=0x006D0000, 
size=0x0001E000 segment=__TEXT in Segment::map() mapping
/private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605-
FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests

      

How to fix it?

+3


source to share


2 answers


You should first make sure that your debug symbols in the test target are set up like this:

enter image description here

Then make sure that you do not have classes in your test target compilation sources in the build phase that are not testing and that you have your application target as a dependency target in the build phase of the target.

enter image description here



Then, in the general tab of your test target, make sure the test app is installed and there is a checkmark in the host API testing permission

enter image description here

last but not least, you have to make sure that the device your test is running on is not running iOS 8.0 (yes, eight points zero), either 7.1.2 is good or 8.1 - if your xcode does not support 8.1, you need to download this support - it's already available via the download section in xcode preferences.

enter image description here

0


source


I followed Lena Bru's stairs but that didn't fix my problem. Then I found this question about code spoofing issues. I checked the general tab in my project settings and found out that "Command" is set to "No". After choosing a command, my tests run without problems.



+1


source







All Articles