20

When I run the app in Xcode IOS 6 beta 2 firmware on the device 8 Beta 2, I get the error message: "dyld: could not load inserted library '/ USR / Library / libgmalloc.dylib", because the image was not found. "

What could be the problem?

Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93
Fanruten
  • 3,782
  • 4
  • 19
  • 15

7 Answers7

49

Disable "Enable guard Malloc" from diagnostics to run app in device.

Abdul Rehman
  • 613
  • 6
  • 9
  • This fixed it for me. – olynoise Jun 11 '15 at 22:21
  • I cannot debug the guard malloc in device? – madlymad Feb 02 '16 at 08:49
  • Thats y i have answered, disable guard malloc – Abdul Rehman Feb 03 '16 at 09:25
  • 1
    this worked for me, in ios 10.3, swift 3.1 and xcode 8.3 – Julio_oa Apr 19 '17 at 00:47
  • Hm, but I actually enabled this myself to guard malloc on the device, and then started getting this error. So, I guess no luck, cannot fully debug on real device which is a shame because I need to debug my Bluetooth code, which is not available in emulator. – JustAMartin May 25 '17 at 14:30
  • Works for me, in iOS 13, Swift 5.1 and Xcode 11. And for those wondering where `Guard Malloc` is: Click on the current scheme > Edit Scheme > Run tab > Diagnostics > `Guard Malloc` checkbox – wzso Mar 26 '20 at 02:39
2

This is because Xcode mount wrong DeveloperImage. If you open the Settings-> Developer you will see that the "Enable UIAutomation» and others are missing.

For fix:

  1. move all folders from "/Applications/Xcode6-Beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport" except "8.0 (12A4297e)" to safe place
  2. reboot the phone
  3. connect your phone to xCode 6 beta 2
  4. restore folders in DeviceSupport

This is the only thing that helped me. Even re-flashing on ios8 beta2 does not helps.

Fanruten
  • 3,782
  • 4
  • 19
  • 15
0

If you're using any 3rd party IDEs for iOS development (e.g. RubyMotion) you should be able to fix this by rebooting your device without that 3rd party IDE running and building and running an app on your device from Xcode.

clarkcox3
  • 580
  • 4
  • 12
0

I've been seeing this on Xcode 7.1. My quick and dirty solution has been to open the right sidebar of the playground, and toggle the platform setting under "Playground Settings".

In my case, I toggled from iOS to OS X and viola, playground compiles and runs as expected.

Reboots had no effect in my case.

Mat Davidson
  • 181
  • 1
  • 8
0

Just restart your iPhone. It worked for me.

gabo
  • 1,133
  • 8
  • 7
0

Disable "Enable guard Malloc" from diagnostics to run app in device. Edit Scheme step - 1 enter image description here

Step 2: enter image description here you can see Memory Management Uncheck Guard Malloc

AyAz
  • 2,027
  • 2
  • 21
  • 28
-2

Try deleting the app from the device and then reboot. Worked for me.

eirik
  • 407
  • 1
  • 4
  • 9