How do I install Xcode to ask before exiting? It happens that I accidentally press command-q and it closes all windows. Is there a setting to prevent this and a confirmation dialog pop up before closing everything?
You can remove the key binding from the Xcode> Preferences ... menu, then click Key Binding and change the Quit Xcode value to blank or something less prone to clicking, like CMD+ Option+ Q.