Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question
    

11 Answers 11

Same thing happened to me but I got it installed today. Two possible reasons,

  1. Apple have finally fixed it
  2. App update has some issue with the mac going to idle mode. Because today I downloaded it while I'm working and my failed attempts were when I left the mac idle while it is downloading
share|improve this answer

I had a similar issue but with a different application. It had downloaded about 70% of the way there on Mountain Lion before the OS went to sleep. This lead to the "Failed to download/Use the Purchases page" error. After some web searching I found this thread that answered my problem:

https://discussions.apple.com/thread/4362474?start=0&tstart=0

The solution for me was to open activity monitor, double-click the AppStore process, and select "open files and ports". Somewhere in this list is a folder starting with "/private/var/folders/". For me it was:

/private/var/folders/hw/...

I quit the AppStore, deleted this folder, restarted AppStore. After clicking "install" again the download started fine.

share|improve this answer

I wanted to add my experience to this thread to help searchers. This has been bugging me for months and I was determined to sit down and fix it. The fact this Q refers to xcode is completely immaterial, I was seeing this issue across several apps with no commonality. I tried numerous searched fixes, including

  • wiping all caches, cookies amd such like
  • relogged into my account, signed out signed in etc
  • rebooted, reset app store, manually deleted caches and such like
  • screwed about with DNS, networking as mentioned in some quarters (red herring IMO)
  • enabling the debug menu for app store ( defaults write com.apple.appstore ShowDebugMenu -bool true ) - this is what ultimately lead me to my solution

My symptoms were: various apps were uninstalled (moved to trash can etc) OR were updated over time. Then app store would show same apps and "Update" button. You click it, and the "an error occurred" message would appear, then the "Please use Purchase page..." Using purchases page buttons resulted in the same error. I tried dozens of combinations of solutions and googled it to death.

The solution in the end was quite odd. With the debug menu enabled, I switch on logging level 2 (at random), tried to reinstall a smallish app I bought a while back. Then skimmed through "/var/log/install.log" I saw an extract like this (some IDs deliberately obfuscated due to paranoia)

Dec 30 19:00:36 macbookpro installd[23755]: PackageKit: ----- Begin install -----
Dec 30 19:00:36 macbookpro installd[23755]: PackageKit: request=PKInstallRequest
<1 packages, destination=/Volumes/Iomega_HDD>
Dec 30 19:00:36 macbookpro installd[23755]: PackageKit: packages=(
    "PKLeopardPackage <file://localhost/var/folders/hb/6_bxxxxxxxxxxxxxxxxxxxx/C/com.apple.appstore/xxxxx3/xxxxxxxxxxxx33.pkg#com.neatberry.PhotoStyler.pkg>"
)
Dec 30 19:00:36 macbookpro installd[23755]: PackageKit: Install Failed: Error Domain=NSCocoaErrorDomain Code=640 "You can’t save the file “Iomega_HDD” because the volume “Iomega_HDD” is out of space." UserInfo=0xxxxxxxxxx     {NSFilePath=/Volumes/Iomega_HDD} {
        NSFilePath = "/Volumes/Iomega_HDD";
    }

And there it was - a weird reference to an external drive during an install.

My "Iomega_HDD" is a FW drive always attached. I was using it for SuperDuper root disk mirroring. However my files had grown bigger than the drive, so it had been sat mounted and idle for probably 8-12 weeks (do not worry: timemachine was working to a NAS :-)

Being a mirror, and mounted, I can only assume that somehow app store monitored, or maintained some sort of linkage to the files on there, eg so previously deleted / purged apps on my root drive were present on the mirror.

Anyway, long story short, I unmounted the mirrored external drive, restarted App Store, used the debug menu item to "reset" and amazingly, all the apps magically corrected themselves to "Install" rather than "Update" and the Install/Update statuses also corrected themselves. And more importantly, all the buttons worked and no more error messages!!

I know how bizarre this sounds but the proof is in the logs. App Store was taking into consideration a mirrored (idle) drive that had legacy copies of the apps on.

share|improve this answer

I had the same issue. I basically used Aitch's solution which is to unmount any cloned hard drives.

To discover the error and solution, I followed Aitch's steps.

1) Enabled debug menu in App Store using Terminal command ( defaults write com.apple.appstore ShowDebugMenu -bool true )

2) Quit and relaunch App Store app.

3) Enabled logging level 2 in the App Store Debug menu, and tried to install an app that was resulting in the error.

4) Skimmed through "/var/log/install.log"

My logs showed: "You can’t save the file “MyHDClone” because the volume “MyHDClone” is out of space."

So, it appears that the App Store was reading information from an external drive that I use to keep a bootable clone of my internal drive.

I unmounted the external clone, Quit and restarted the App store and whola! All my apps were back in correct status. Several of the "updates" that were previously showing were now gone because I had updated them on my internal drive, but had not updated my clone, which is where the App Store was reading the status from.

share|improve this answer

The solution for me was quite simple, if a bit odd. I quit App Store, relaunched it, then 'quit process' from Activity Monitor. After that I relaunched App Store again and the app downloaded fine.

share|improve this answer

Similar story here.

An external drive I had attached for a Carbon Copy Cloner backup had also been left attached for some time. I noticed that the activity light was flickering so I ejected it. Finder complained that an app was accessing it, but why should it, only CCC accesses this drive. Assuming it was spotlight acting daft, I force-ejected it.

Shortly after, the app store app showed errors in updates it was carrying out, including an Xcode update that I was sure it had already done a couple of days ago.

Simply unmounting it and restarting App Store didn't help. Deleting the caches for App Store didn't help.

I followed the tips here (enabling Debug, performing a reset) I then rebooted and opened App Store again. I had to sign-in and only one app (out of the four that had been updating) was shown as update available. This updated without error. I therefore assume the other three had been apps that the App Store had been trying to update on the mirrored external drive.

There is clearly a bug here that the App Store is going looking on external drives rather than sticking to the apps it installed in the internal drive.

share|improve this answer

I tried many suggestions related to this error. Saw that the city name on my credit card info was wrong. Updated by Credit Card info in the App Store, validated the account on my new Retina and then was able to update iPhoto, iMove and Garageband. Validate your credit card on the new machine. Werken

share|improve this answer

The steps to get things to work are quite simple.

  1. Keep the AppStore App open.
  2. Open terminal and type

    cd /private/var/folders/
    
  3. Once there, search for com.apple.appstore

    find . | grep com.apple.appstore
    
  4. You will find folder structure like this ./40/lhn22jn901zdw2bpf82hkggw0000gn/C/com.apple.appstore

  5. Once inside the folder, open it in finder

    open .
    
  6. You should see a folder and a manifest.plist. Open up the plist to see the file. Towards the end you will see lines which says that key is title, and string is XCode.

  7. Now you have the folder which is making your life miserable.
  8. While keeping AppStore open, remove this folder

    rm -rf *
    
  9. Now, go back to AppStore and click on Download again.

share|improve this answer
    
My vote for the best answer. –  Kunal Vyas Apr 21 '13 at 15:48
    
Did not work for me :( –  alopix Oct 6 '13 at 9:49

The problem was with mac (10.8.3) in idle mode, i was working on VMWare.I started downloading xcode (4.6.3) on VM and roaming around for break leaving my system.I came back and found xcode failed to downloading with kinda purchase page...message. I signed out from developer apple, then quit app-store.Again launch app-store and login. Now installation successful.

share|improve this 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.

share|improve this answer
    
Thank you so much for this! What an obtuse bug. –  Archagon Oct 8 '13 at 21:04
1  
After resetting, I also had to quit the AppStore application. –  Epu Nov 4 '13 at 23:52
    
Just signing out does not help. I tried signing out, closing the App Store application, re-opening and signing back in, but still faced the same problem. Following your instructions to Reset Application did solve the problems perfectly though! –  ehdr Apr 20 at 5:10

You could use the direct link to download xcode from the Developer Center: https://developer.apple.com/downloads/index.action

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.