I am running Xcode 4.3.3 on the new Macbook Retina and out of the blues Xcode started freezing right after launching. I was in the middle of working on two projects so when Xcode starts up it immediately launches the two projects I was working on. The first one loads sometimes but the second one always freezes. Because the project launches right away I cannot access any of Xcode's features. I can't even figure out how to stop the project from launching on start up. Here is what I have done thus far:
So what the heck is going on? I would prefer to use User1 and would like to actually solve the problem so that I don't need to make a new user if it happens again. (User n+1, indefinitely is not an attractive option).
Check out this: (quoted from here)
Restore sanity by not restoring
Thanks to Lion's Restore feature, all the windows you left open in a given application remain open when you relaunch it. That's awesomely helpful in a Web browser or a text editor. In certain apps, however—particularly those where you rarely need to revisit the same documents—the feature is more of an annoyance. Window resuming is actually configured on an app-by-app basis. Here are the Terminal commands to disable Resume in Preview and QuickTime Player X:
defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false defaults write com.apple.QuickTimePlayerX NSQuitAlwaysKeepsWindows -bool false
Quit the apps before you try the commands. Again, swap "true" for "false" to reverse your change.
You may be able to do something similar for Xcode.
Otherwise, you can quit an application in Lion and discard the previously open windows by holding the option
key while pressing CMD+Q
. So you could try starting Xcode and quitting it with option held before it's had a chance to open your windows, then re-launch it and it shouldn't try to open the windows. Then you can try to fix the problem.
Update: Here is some additional information from comments that solved the problem...
Now to try and fix the project... Remove the following directories:
MyProject.xcodeproj/xcuserdata
MyProject.xcodeproj/project.xcworkspace/xcuserdata
Those directories store things like window positions, what files are open, which project groups are expanded, etc. so one cause could be if you use source control across multiple machines that have the same username and those files aren't ignored (which they should be if you're using source control). Retina vs. non-retina or different versions of Xcode could use those files differently and the source-control merging could make them inconsistent. So make sure you remove and ignore these directories in source control so that they don't get re-added and cause the problem again.
What fixed this for me was removing unsaved document in ~/Library/Autosave Information
. After Xcode launched without any problem.
Using answer in apple.stackexchange.com did the trick for me:
Removing the
~/Library/Saved Application State/com.apple.dt.Xcode.savedState/
directory might help.
If this did not work, then remove
~/Library/Developer
(brought from here and here)
Open your project and then right click on yourprojectname.xcodeproj
then click on Show package contents
.
There you're going to see the xcuserdata
. Delete it.
Next, right click in project.xcworkspace
, click on Show package contents
and delete the xcurserdata
.
At the end, restart your Mac and re open your project, everything should be fine again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With