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
    

17 Answers 17

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
    
Did not work for me either :( –  Joel Oct 2 '14 at 0:56
    
You deserve a million up vote. Although developers would understand more than regular users, but this did the trick :) –  Nour1991 Oct 8 '14 at 1:27

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
2  
After resetting, I also had to quit the AppStore application. –  Epu Nov 4 '13 at 23:52
1  
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 '14 at 5:10
    
This worked for me when things got hung up downloading Xcode 6. –  James Sep 19 '14 at 20:31

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

share|improve this answer
    
the best (since quickest) answer for me. Dont understand the downvotes –  brainray Nov 10 '14 at 11:55

Me also face this issue. I asked to My System Admin. They Remove firewall restrictions. then its downloaded fine.

It may help for some one.

share|improve this answer

This is a dumb one, but I found that the reason I was receiving this message was that my hard drive was full. So I cleared up some space and it installed just fine.

Facepalm.


Truth be told, the App Store should have better messaging around this. It's not an unknown error, we totally know what it is.

Be forthright, App Store, come on.

share|improve this answer
    
i experience the same thing –  John Bachir Oct 15 '14 at 15:12
    
How much space did you need? –  Mark Simpson Dec 14 '14 at 0:27
    
I had about 8 GB and I got the error. Made space for about 12 GB, got it installed. It still showed the error in the App Store though, after restarting it recognized that Xcode got updated, all good... Bad Error-Messaging... -.- –  marczking Feb 2 at 14:45
    
If you clear up some space for XCode, be sure to empty your trash. –  zzg Feb 27 at 15:38
    
Oh wow. Same for me, had about 7gb left. –  Tim Wachter Apr 27 at 20:10

One of the answer posted that mentioned the lack of disk space was my problem (but I can't comment on it because my reputation is still too low).

I had 7Gb of hard drive free space and was getting that error. Tried the main solution and all the other ones posted and none of them worked.

Then I tried freeing up hard drive by uninstalling a bunch of apps I no longer need and got about 45Gb free, then tried installing again and this time it worked without a hitch.

So yeah, bad error message from the App Store -- and it should verify you have enough space for the installation before it tries to download. I think currently it downloads the package first which is 2.5Gb ish, and then tries to unpack/verify that there's enough space for the actual installation, which requires a lot more, and fails here with a miserable generic error message if there isn't enough.

The error message itself should also be clearer and indicate that the reason for failure is not enough hard drive space for the installation.

My guess is you'll need about 10Gb+.

share|improve this answer

Here's what worked for me:

  • Good network connection
  • Enough free space (if you need a few GiB, just sudo rm -f /var/vm/sleepimage, osx will recreate it as needed)
  • Check 3rd-party app firewall for interfering "deny" rules
  • Close App Store
  • rm -rf /private/var/folders/pd/*/C/com.apple.appstore
  • Reboot
  • Run updates (works!)

To see what's going on while updates are installing:

  1. Set debug menu defaults write com.apple.appstore ShowDebugMenu -bool true
  2. In App Store > Debug, Debugging Level 4, Log XML, Log Headers & Javascript Logging
  3. In Terminal: tail -f /var/log/installer.log /var/log/commerce.log
  4. Run updates
  5. Be sure to disable debugging options before disabling the Debug menu
share|improve this answer
    
worked fine. Tnx –  Mircea Stanciu Apr 22 at 11:43

Two simple solutions. 1) remove old X-Code install, restart, and re-download. or 2) Circumvent the app store, and download image direct here http://adcdownload.apple.com/Developer_Tools/xcode_6.1.1/xcode_6.1.1.dmg

share|improve this answer

In my particular case, the only way to fix it was to turn off my company's VPN.

Details: I was trying to install XCode 6.3.1 on OS X Yosemite v.10.10.3. All of the previous solutions didn't work, although the suggestion to debug the installation process through App Store and to tail the log files were crucial to find the root cause.

Steps to find the root cause

  1. Activate debug menu on a Terminal window:

    defaults write com.apple.appstore ShowDebugMenu -bool true

  2. Now on App Store, go to Debug menu and check, Log XML, Log Headers, Debug Logging Level 2* and Javascript Logging

enter image description here

* you should try other levels if 2 is not enough

  1. Back to Terminal, run tail -f /var/log/install.log /var/log/commerce.log

  2. Start the Installation on App Store and follow the logs on Terminal

Root cause of particular issue

I found these messages on the log, pointing out to a network failure and request timeout:

==> /var/log/commerce.log <==
Apr 23 10:10:58 macbookname storedownloadd[1234]: Logged "Request"
Apr 23 10:11:59 macbookname storedownloadd[1234]: ISStoreURLOperation: Waiting a bit before retry #2 after a network failure
Apr 23 10:12:00 macbookname storeaccountd[2345]: ADI: Account is not provisioned, omitting OTP and MD
Apr 23 10:12:00 macbookname storedownloadd[1234]: -[ISURLOperation _logRequest:]: Sending request for http://a71.phobos.apple.com/us/<obfuscated-value>.pkg
Apr 23 10:12:00 macbookname storedownloadd[1234]: Logged "Request"
Apr 23 10:13:01 macbookname storedownloadd[1234]: ISStoreURLOperation: Chose not to retry after error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=<obfuscated-value> {NSLocalizedDescription=The request timed out.}
Apr 23 10:13:01 macbookname storedownloadd[1234]: AssetDownloadOperation: Asset download cancelled/failed.  Will do retry #1? 0
Apr 23 10:13:01 macbookname storedownloadd[1234]: DownloadOperation: Download failed with error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=<obfuscated-value> {NSLocalizedDescription=The request timed out.}
Apr 23 10:13:01 macbookname storeassetd[3456]: SoftwareMap: No app was found with bundle ID com.apple.dt.Xcode to upgrade to 6.3
Apr 23 10:33:14 macbookname storedownloadd[1234]: sending status (Xcode): 0.000000% (0.000000)

Once I turned off the VPN, I was able to download it successfully, tracking the Received Bytes of the storedownload proccess on Activity Monitor > Network tab: enter image description here

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.