6

XCode fails to open on my machine - OS X 10.8.2. It opens the main screen and just hangs there with the spinner spinning becoming unresponsive. If I double clcik a project, it just hangs sating it is loading.

I tried:

  1. Uninstalling and re-installing;
  2. Removing my project tree;
  3. Deleting some recommended preferences, most of which did not actually exist on my machine to begin with.

Things of note:

  1. This is a new computer. The first time I ran XCode, it opened fine, though I didn't try using it. The problem appeared when I first opened an existing project.
  2. I created a new user on the machine. When that user is logged on XCode loads successfully. Apparently it is a user settings issue.
  • For user settings look in ~/Library/Preferences and look for anything with Xcode in - try deleting them – user151019 Mar 19 '13 at 21:56
  • The irony - a developer tool hanging. You could always run sysdiagnose on Xcode and submit a bug report to Apple :) – bmike Mar 20 '13 at 4:15
  • @Mark, I tried that. No avail. – Adi Shavit Apr 4 '13 at 11:33
  • You need to unhidden files first then try this : stackoverflow.com/questions/19473231/… – user66483 Jan 5 '14 at 8:57
  • 1
    @bmike - Xcode is without any doubt the worse piece of software Apple ever wrote. Xcode was always bad but things escalated with Xcode 4. It is a shame that they continue to cram crap to the app instead of fixing errors that are there since Xcode 4. I need to hire someone to invent new profanities to me because I have used my repertoire. – SpaceDog Sep 29 '14 at 22:44
20

Removing the ~/Library/Saved Application State/com.apple.dt.Xcode.savedState/directory might help as well.

  • This does not work with xcode 7+. See @adi-shavit answer. – Broonix Nov 17 '16 at 14:46
12

No need to reinstall XCode.

Based on this:

  1. I deleted all XCode related "Unsaved Docs" docs found via the Finder search;
  2. I removed the ~/Library/Developer folder;
  3. Emptied the trash.

This worked for me.

  • 1
    rm -rf ~/Library/Developer/xcode worked for me. Thanks for the suggestion. – kandelvijaya Sep 26 '16 at 19:24
  • warning that this will remove all of your simulators and you will have to redownload all of them again if you clear ~/Library/Developer folder – Charlton Provatas Aug 25 at 22:12
  • Caveat: This is a pretty old q+a by now. – Adi Shavit Aug 26 at 4:20
3

A slightly improved answer:

I didn't need to reinstall xCode at all, just remove the 'unsaved documents':

Search in ~/Library for xcode (by name) (to search, you go to this folder, enter xcode, with the drop down choose "by name", and then click the "Library delete anything matching in ~/Library/Caches or "~/Library/Autosave Information" or that looks like it might be an unsaved documents

2

I had a similar problem where xcode was hanging on opening one particular project. I wanted a very precise fix without having to remove all the settings. I deleted proj.xcodeproj/project.xcworkspace/xcuserdata/<user>.userdatad/UserInterfaceState.xcuserstate from the .xcodeproj folder and that solved the problem.

So if you are having Xcode hang while attempting to open one particular project, this is the file that you need to delete.

  • 1
    Already tried... but still not responding – Tahmid Rahman Oct 23 '17 at 11:28
2

My problem was due to iCloud. All my projects were inside documents folder which is iCloud folder. Because iCloud settings in my MacBook was with the optimize option, the content of files weren’t allocated locally in the hard drive but remotely in iCloud. That was the cause for unresponsiveness of Xcode when loading the project or even starting new one. I moved all the projects to local folder in hard disk not included as a backup for iCloud and it solved the problem.

  • You are right. It's the same issue a colleague of mine had. She had iCloud Drive enabled on her Document and Desktop in her macOS Settings and was incredibly unresponsive. I bet she won't use it again! – pechar Oct 29 at 10:48
0

Deleting the latest file (GPUToolsAgent.sock ) in that Xcode directory solved it.

Eds-MBP-3:echo ed$ ls -artl ~/Library/Developer/Xcode/
total 0
drwxr-xr-x   2 ed  staff   64 Apr  2  2018 DocumentationCache
drwxr-xr-x   5 ed  staff  160 Feb 28 13:49 ..
drwxr-xr-x  17 ed  staff  544 Apr 19 20:39 iOS Device Logs
drwxr-xr-x   7 ed  staff  224 Apr 29 12:18 DerivedData
drwxr-xr-x   5 ed  staff  160 Apr 29 12:40 UserData
srwxr-xr-x   1 ed  staff    0 Apr 29 13:56 GPUToolsAgent.sock
drwxr-xr-x   7 ed  staff  224 Apr 29 13:56 .
Eds-MBP-3:echo ed$ rm -f ~/Library/Developer/Xcode/GPUToolsAgent.sock 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .