Xcode 12 not responding

Since 2 days ago my Xcode will not respond anymore. It started before I updated to Big Sur 11.2.3 and is still happening. I've tried a full reinstall and all I get is Not Responding in Activity Monitor. This is really frustrating as I've to get a release out this week. If anyone has any ideas other than the 2 year old threads about removal of all the Xcode related directories then please let me know. Everything else is running fine on my 2019 16-inch MacBook Pro and there are no memory issues. Stumped..
I had a similar issue a few days back with Xcode 11.4, but I was on Big Sur 11.2.2. Not sure if this will help you but I read somewhere on SO that it was a bug to do with any physical device you had connected to Xcode to run your app on with connect via network checked. So for me I simply unpaired any devices I had connected to Xcode and only tested on the simulators, which worked fine and stopped Xcode from freezing literally every time I done anything.

I had already tried restarting everything, etc, etc but nothing worked until I unpaired any physical devices. I've since updated to Big Sur 11.2.3 and repaired my iPhone to Xcode, so far haven't had any issues with it freezing.

Thought the new OS update fixed it but reading your post I guess not. Hope I helped.
I've resolved this myself but just in case anyone else comes across this issue here was the problem.

I had tried to open a Json file a few days ago and it had tried to open in Xcode. The file was only a few MB but Xcode could not handle it.

Now every time I tried to reopen Xcode it was trying to open this file and would just hang.. not fail or given any error.. it would just hang and force quitting would show this in the stack trace.

so reinstalling and removing all traces of xcode doesn't seem to stop the OS from trying to reopen this Json file when I loaded Xcode again.

Shift+Option click on Xcode opens it without trying to reload previous files..

simple when you know how but really.. error handling is appalling..
Xcode 12 not responding
 
 
Q