29

It seems that after upgrading to Mac OS Mojave + Xcode 10 it's not possible to debug custom views on Xcode, from Editor -> Debug Selected Views menu (see screenshot)

Editor -> Debug Selected Views menu

Always receiving the same message (see screenshot):

Ensure "IBDesignablesAgent-iOS" is not already running, and 'username' has permission to debug it.

Ensure IBDesignablesAgent-iOS is not already running error

Previously Xcode asked me for entering my credentials before debugging a custom view. Now it always fails. I have the problem on two different Macs (using the same Developer account)

Is anyone experiencing the same issue?

Is there any way to troubleshoot the problem in an effective way?

What I tried at the moment, following suggestions here:

  • Restart Xcode: Done, not effective
  • Completely uninstall, delete any related file and reinstall Xcode: Done (twice), not effective
  • Edit Scheme -> Info -> Executable -> Ask on launch: Done, not effective
  • Multiple Xcode version installed: Doesn’t apply.
  • Deleting certificates from Keychain: Done, not effective
  • Delete derived data and clean: Done, not effective
  • Killing simulator: Done, not effective
  • Debug executable is enabled: Doesn’t apply.
  • Run Xcode with sudo: Done, make it worst
lechuckcaptain
  • 1,032
  • 1
  • 9
  • 25
  • have you tried the solutions available in https://stackoverflow.com/questions/44651029/xcode-9-could-not-attach-to-pid – Sateesh Yemireddi Oct 20 '18 at 16:37
  • Yep, nothing is working (I'll update my answer, thanks). Please also consider that I dont' have problems debugging with Simulator nor real devices. Only problem is debugging custom views – lechuckcaptain Oct 21 '18 at 09:16
  • Did you ever find a solution to this? I've been through all of the same steps you have and nothing works. – DiddleDot Nov 02 '18 at 21:35
  • 2
    Sadly I didn't find a solution or workaround. In the meantime I also opened a bug report to Apple and they marked it as Duplicated of another (bug 45217745), so I'm guessing we're not the only ones experiencing the issue, but the status is still open at the moment. – lechuckcaptain Nov 03 '18 at 12:45
  • Boo, hiss. Came here from [here](https://stackoverflow.com/a/26414900/1214800), and now we're full stop. – brandonscript Feb 19 '19 at 18:14
  • I was also getting the same errors and found this way to debug my IBDesignable errors: https://stackoverflow.com/a/55614319/60949 Hope it helps! – Stelabouras Apr 10 '19 at 13:52
  • Thank you @Stelabouras , but that's not a real debug isn't it? It's just reading the log of the crash of IBDesignable tool. What is strange to me is that we have a button in Xcode called "Debug Selected View", that should do a specific job, but instead is just crashing miserably. – lechuckcaptain Apr 10 '19 at 14:05
  • BTW, bug seems present also in latest Xcode 10.2 – lechuckcaptain Apr 10 '19 at 14:06
  • @lechuckcaptain Yes, it's not a real debugging tool per-se (no callstack, breakpoints etc) but it helped me figure out what was crashing the agent and generating those errors. For example in my case, I had to re-assign all of the referencing outlet connections to the File's Owner. – Stelabouras Apr 11 '19 at 07:04

1 Answers1

2

It's Apple bug and there is no workaround I know about.

I've filed bug to Apple as well. And it got marked as duplicate.

I encourage everyone who has this problem to do the same. If several people are filing the same bug report it'll indeed increase its priority by Apple internally.

Andrei Konstantinov
  • 6,971
  • 4
  • 41
  • 57
  • Any updates on filed bug to the Apple (link?) after more than one year? – A. Petrov Feb 15 '21 at 07:17
  • forget. This menu item is just not enabled (and I am missnotice it) while in xib and subclassed view hierarchy. Item for "debug selected view" active only in storyboard with added custom view. – A. Petrov Feb 15 '21 at 07:41