Xcode failed to download. Use the Purchases page to try again Xcode is showing in the Mac App Store, ready to be updated. Clicking update results in an error:


  Xcode failed to download. Use the Purchases page to try again.


Steps taken that didn't help:


Rebooting
Removed ~/Library/Cookies/com.apple.appstore.plist
Searched and removed MAS-related files:

sudo find /var/folders/ -ipath '*com.apple.appstore*' -print | xargs sudo fgrep -i xcode
sudo find /var/folders/ -ipath '*com.apple.appstore*' -delete



How can I successfully update Xcode?
Deleting the temporary folders as recommended didn't help. In the end I got it working again by enabling the Debug menu for the App Store app and resetting the application; it is now finally downloading the update as it should.

Steps:


Open Terminal.
Run the following command:

defaults write com.apple.appstore ShowDebugMenu -bool true

Relaunch the App Store.
Choose the menu item Debug → Reset Application.


Based on steps from: https://discussions.apple.com/thread/4398074?start=0&amp;tstart=0

It is possible that signing out (Store → Sign Out) might have solved the issue too (part of the application reset process is to sign you out) but this was not tested.