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

mac-appstorexcode

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?

Best Answer

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:

  1. Open Terminal.

  2. Run the following command:

    defaults write com.apple.appstore ShowDebugMenu -bool true
    
  3. Relaunch the App Store.

  4. Choose the menu item DebugReset Application.

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

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