Xcode freezes on startup while loading project
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:
- Rebooted comp – still launches projects and freezes
- Deleted everything in cache ~/Library/Developer/Xcode/DerivedData – still launches projects and freezes
- Uninstalled Xcode (hold click in Launchpad, click the (x)). Reinstalled Xcode. – Still launches the projects and freezes
- Moved my projects from original folder – Still launches the projects and freezes
- Created a new iOS user2 and launched Xcode – does NOT launch projects OR freeze yay!
- In user1 copied freezing project to external, logged in as user2, launched project – Does NOT freeze! But now I need to transfer my Xcode profile and certificates to the new user.
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).
- Xcode 6.1 keeps telling me some PartialInfo.plist couldn't be opened
- Scrolling UILabel like a marquee in a subview
- Xcode 8 custom font doesn't show up in interface builder
- Story link flow using SSO facebook - openURL not being called
- Text field for currency Swift
8 Solutions Collect From Internet About “Xcode freezes on startup while loading project”
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:
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.
I fixed this condition by renaming the root directory that contains all the Xcode projects.
While Xcode is not running, rename the directory, then start Xcode. Xcode won’t be able to find the projects and will silently ignore them. Quit Xcode, revert the directory back to the original name, and start Xcode again. It should not try to load the projects at startup.
Not sure why this works but your step #4 (moving the projects) does not.
I experienced the same problem today, with the same configuration of Xcode 4.3.3 running on a retina display MacBook Pro. I read through this page, and decided to first try deleting the files listed above by jhabbott: MyProject.xcodeproj/xcuserdata and
MyProject.xcodeproj/project.xcworkspace/xcuserdata directories. That worked. After deleting the files I was able to start Xcode and then open my project by selecting File > Open Recent. You can delete those items directly from Finder if you hold down the command key and click on the project file, and then from the menu choose Show Package Contents.
I accidentally double-clicked on Projects folder in Xcode Open project dialog, it tried to open all projects at once, and freezed. Advices from this branch did’t help, but after some searching i found the files, that should be deleted. Locate current_user/Libraries/Autosave Information and delete all Xcode-related from there, that should help.
A problem which I had: When I added a casetagram library into my project, then a few seconds after launch of Xcode, before indexing of files (as I think), it had become freezes. After simply rename folder on other name and rename it back – Xcode freezes again.
- Command-Option-Shift-K to clean out the build folder.
- quit Xcode and clean out ~/Library/Developer/Xcode/DerivedData manually
If you have some time before Xcode will be frozen:
You must launch Xcode, then quickly open Organizer->Projects and remove your project from list (project, on which Xcode freezes).
If you haven’t enough time for open of organiser then:
1) quit from Xcode.
2) rename folder where your project is located. Then perform the 1 variant of solution (open organizer and remove project on which Xcode will be frozen)
3) rename your folder back
If Xcode will frozen after all of this actions, try to open other project and compile it. If it works, go back and try build your project on which Xcode was frozen. If Xcode again will be frozen then reason of it at this concrete project
You just need to remove these directories:
As jhabbott says, these directories store the locations of open files, windows, etc. and can be safely deleted. Generally the issue is that you have a reference in the xcuserdata to an old network share that doesn’t exist any more, and xcode sits there for a long time trying to access it.
Make sure you delete these directories for all your XCode projects.
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
At the end, restart your Mac and re open your project, everything should be fine again.
- Is there a way to instantly generate an array filled with a range of values in Swift?
- How to get button to display different video according to the row it is pressed in?
- Keep iphone active while running program
- Remove/hide Full screen button from MPMoviePlayerController Standard Controls
- xcode won't compile iOS apps, crashes when .xib or .storyboard files are opened
- Voip(Voice over IP) missing in Xcode 9
- Getting the Value of a UITextField as keystrokes are entered?
- Xcode 8.2 simulator crash and quits on saving a screenshot while debugging
- AlamofireImage how to clean memory and cache
- 2D distortion of a face from an image on iOS? (similar to Fat Booth etc.)
- Paging results from Core Data requests
- UIPopoverController too large and UIPickerView too small
- Where did the Homekit Accessory Simulator go in Xcode 6 beta 6?
- ALAssetsLibrary seems to return wrong number of my photos
- Invalid or missing Program/ProgramArguments