How to install XCode on OS X 10.8.2
XCode 5 requires 10.8.4 as a minimum.

If you have a Apple developer account, you could try to download an older version (XCode 4.6.3 should work in 10.7 or 10.8).

However, XCode 4.6.3 is still a hefty download (1.81 GB). It may be cheaper for you to download &amp; install OSX 10.8.5 rather than XCode 4.6.3 - especially if you've already downloaded XCode 5...