I’m having this issue where when I attempt to debug some code using Monodevelop I consistently get a hang when attempting to attach to the unity process. I have gotten it to work once or twice, but in general it pretty much never works.
Coworkers have no issues debugging the same project on both PC and Mac, so I don’t think it’s an issue with my project.
Repro steps:
Launch Unity
Launch Monodevelop
In Monodevelop Run->Attach To Process
Clicking attach to process will cause the hang. Sometimes though clicking anything causes a spinning beach ball hang, and sometimes just doing nothing and clicking the window will cause a hang.
My setup:
Macbook Air running Mavericks (10.9)
Non-pro Unity 4.3.0f4 (though I had the same issue running 4.2 and 4.3 beta)
MonoDevelop 4.0.1
Things that may be unique about my setup:
I occasionally write code in Sublime Text 2, making use of the CompleteSharp plugin which I believe runs a mono process. The issue occurs whether I have Sublime Text open or not.
My project lives on an external HD. The only time I have ever gotten debugging to work was when I moved my project to my computer’s local drive, and so I thought that fixed the issue, but since then I’ve still been getting the same issue whether the project is on local storage or external.
I’ve got some hangs too, however it also worked some other times.
When I get a hang, then trying again will always hang again, so restarting both Unity and MonoDevelop is necessary: usually it works after doing that.
(I guess it’s not your case, I assume you already tried to restart both)
Also I have the feeling (not tested it properly) that it tends to hang more likely if I attach when Unity isn’t playing.
I noticed with 4.3.2 there’s this interesting line in the change list which got me excited: “Debugger: Avoid deadlocks on OSX.”
I downloaded and tried out 4.3.2 before Christmas and it seemed fixed. I was able to set a breakpoint and stop on one!
Unfortunately I just tried to set a break point for the second time ever and… it doesn’t work. The same issue persists. Did I somehow get lucky the first time? Maybe some other thing I did when I reinstalled Unity? I have no idea, but the problem unfortunately persists for me.
I’m having the same problem on 4.3.2f1 on Mavericks. The key for me is if I double-click the Unity application from the list that appears IMMEDIATELY when hitting ‘attach to process’, it will connect and work properly. It seems that once I wait a few seconds and then try to click, the dialogue becomes unresponsive and my only recourse is to kill the app and restart it. While it is in the broken state, the cursor will alternate between the ‘waiting’ cursor and the standard cursor, but nothing ever becomes clickable.
I think that this is different from the previous issue where the Unity Editor needed to be actively running a script when you try to connect. Everyone here is already on Mavericks, so I don’t have an easy way to see if it is a Mavericks-only issue.
Hopefully my ‘click immediately’ workaround above helps someone else until the issue is properly resolved.
Upgrading Unity 4.3.3 doesn’t fix the problem. Starting the app first and then trying to attach the debugger is a non-starter as that makes it impossible to really testing Awake() timed events.
I have absolutely the same problem with Unity 4.3.3f1 on OSX 10.9.1. Also my iOS devices never show up on the process list.
Thanks jeremy, your workaround worked for me, it now allows me to at least debug the App running in the Unity Editor.
Any ideas how to solve this, apart from waiting for a solution from the Unity team? It seems this bug has been around a while…
Maybe there is another debugger that works more consistently?
I’m a new user to Unity, so far i have been impressed, but now struggling with the debugger is spoiling my enthusiasm.
This absolutely helped. I always thought giving Monodevelop time was the nicer approach, but if I select the Unity Editor process and press Attach Monodevelop invariably ramps up CPU use and rainbows and I have to force quit.
With this double click method I haven’t had it do this yet!
I’m on Mavericks, having the same problem as previous posters, just posting here to bump this thread and see if there is an official response from the unity team. The debugger is pretty unusable for me.
At least I would like to know if this is a “know issue /won’t fix” problem, or if there is still hope.
Still not fixed in 4.5. Unity, your debugger is broken. It has been broken a very long time. Please fix this. It is very difficult to work in a professional, modern day development environment and not have a functioning debugger. It is bush league and slow-as-hell to have to use log statements.