FireDragonMule
FireDragonMule

Reputation: 1347

Xcode 7.0 XCTest dyld: could not load inserted library IDEBundleInjection

I'm running unit tests on my iOS project and when it's running, it crashes and spits this out:

dyld: could not load inserted library '/private/var/mobile/Containers/Data/Application/1CAB64C8-D730-427B-8E9E-BD5E152ACFD6/tmp/IDEBundleInjection.framework/IDEBundleInjection' because no suitable image found.  Did find:
/private/var/mobile/Containers/Data/Application/1CAB64C8-D730-427B-8E9E-BD5E152ACFD6/tmp/IDEBundleInjection.framework/IDEBundleInjection: mmap() error 1 at address=0x00436000, size=0x00004000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Data/Application/1CAB64C8-D730-427B-8E9E-BD5E152ACFD6/tmp/IDEBundleInjection.framework/IDEBundleInjection

I'm using XCode 7.0 and testing on an iPod running iOS 8.3. I have deleted the derived data and I've restarted XCode and it still hasn't worked.

Upvotes: 22

Views: 5066

Answers (9)

konop
konop

Reputation: 21

I had this same issue and had to reboot my device. I was using iOS 10 with Xcode 8.0 (developing in swift 3.0)

Upvotes: 1

OmniBug
OmniBug

Reputation: 892

I fixed this issue by rebooting my iOS Device.

Upvotes: 0

JBaczuk
JBaczuk

Reputation: 14609

I had my base SDK in XCode Build Settings set to a more recent version of iOS than the phone had, so I had to upgrade the OS on the phone.

Upvotes: 0

Simon Hillam
Simon Hillam

Reputation: 11

In my case there was nothing wrong with the provisioning profiles, it was down to the Architectures in the project excluding arm64. Once arm64 was added to both the test target and the host app target the tests ran fine (On Xcode 7.2). The error was:

dyld: could not load inserted library '/private/var/mobile/Containers/Data/Application/A94F5AD3-2A5F-415D-B127-0F45DEC7A659/tmp/IDEBundleInjection.framework/IDEBundleInjection' because no suitable image found.  Did find:
/private/var/mobile/Containers/Data/Application/A94F5AD3-2A5F-415D-B127-0F45DEC7A659/tmp/IDEBundleInjection.framework/IDEBundleInjection: mmap() error 22 at address=0x00501000, size=0x00005960 segment=__LINKEDIT in Segment::map() mapping /private/var/mobile/Containers/Data/Application/A94F5AD3-2A5F-415D-B127-0F45DEC7A659/tmp/IDEBundleInjection.framework/IDEBundleInjection

Upvotes: 1

taojigu
taojigu

Reputation: 457

In General Panel , not leave the Team to "None"

enter image description here

At Same time : select the code sign in Build Setting->Code Signing-> Code Signing Identity

Upvotes: 5

Drew
Drew

Reputation: 8963

I needed to set the team under Project->App Target->General. It was set to "None", instead of a valid team.

Upvotes: 0

John Goodstadt
John Goodstadt

Reputation: 698

I fixed this by selecting the correct target and then selecting the correct Code Signing Identity from Settings. It was set to a non default - changed to 'IOS Developer' for the Debug setting entry.

Upvotes: 1

FireDragonMule
FireDragonMule

Reputation: 1347

I fixed this by just creating a new UnitTest target, copying everything over, and removing the old one.

Upvotes: 5

Timur Suleimanov
Timur Suleimanov

Reputation: 443

I managed to fix this by specifying my developer certificate in build settings->code signing identity.

Upvotes: 4

Related Questions