Reverting all Xcode settings to their original state
Asked Answered
I

2

41

I got my Xcode into a non-functional state when I can no longer start a search: once I press ⌘+F, Xcode hangs with a spinning pinwheel, and stops responding. Once this happens, my only option is to force quit and restart.

I tried looking for the saved settings in the workspace and project directories, but the recent search options that I am looking to delete appear to be stored elsewhere. I know that I could clear recent searches through the UI, but that would require bringing up the search dialog, which hangs Xcode.

I would like to reset Xcode to its original state. How do I do it without reinstalling Xcode?

Impend answered 15/1, 2014 at 15:13 Comment(1)
Having same issue, any resolution to this? It's a very hard problem to search for. "xcode search crash" yields incorrect results for exampleContemporary
D
70

This is the officially recommended way to delta Xcode 5's preferences, type in Terminal.app:

defaults delete com.apple.dt.Xcode

That should restore Xcode to the state of its first launch.

(for older versions of Xcode the command was defaults delete com.apple.Xcode, i.e. without the dt in the middle).

Diacritical answered 15/1, 2014 at 19:38 Comment(6)
Although this did not fix my Command+F problem, it did clear out the old settings. I updated your answer to work with the current version of Xcode. Thank you very much!Impend
it resolved my problem of not indexing files.. i tried with several steps before. Thanks for the post.Tera
This fixed the problem with my swift files not showing up when I created a new fileDangerfield
I enter the code but nothing happens !! xcode 7.1.1Pastypat
Thank u, this fixed my problem where Xcode was crashing on this error UNCAUGHT EXCEPTION (NSInvalidArgumentException): -[IDE SourceKit Workspace allSymbolsMatchingNames:kind:]:Hickory
Fixed issue where couldn't make a NEW FILEAdvertence
G
23

Reset all XCode settings from command line by running following commands then restart XCode:

defaults delete com.apple.dt.Xcode
rm -rf $HOME/Library/Application\ Support/Developer/Shared/Xcode
rm -rf $HOME/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
rm -rf $HOME/Library/Preferences/com.apple.dt.Xcode.*
Ginni answered 30/7, 2015 at 8:57 Comment(6)
I enter the codes but nothing happens !! xcode 7.1.1Pastypat
i used this for 8.3.2 and now my default theme is blue-ishPlumbaginaceous
I needed this for 8.2.1 - it crashes every time I close a project, so this clears them all out and lets me reload the ones I need manually.Glossal
What is "$Home"?Chinkiang
Path till Root directoryGinni
My Xocde keep hanging all the time, After I run these commands.Thomism

© 2022 - 2024 — McMap. All rights reserved.