Is there an easy way to upgrade XCode Command Line Tools? - xcode

I'm currently on OSX Mountain Lion, but I'm probably going to upgrade my OS pretty soon, either to Mavericks or Yosemite. I'm looking to download command line tools for homebrew; however, looking through the various versions, I'm probably going to have to upgrade command line tools for new versions that are released, and especially if I decide to upgrade my OS.
I've looked at other discussions on StackOverflow that discuss updating, and the threads that I've looked at seem to suggest that uninstalling the old version and then installing the new version is the way to go. However, it seems that the main way to uninstall old versions of command line tools, as mentioned by this thread (How to uninstall Xcode 4.4 command line tools (Mac OS X 10.8 Mountain Lion)?) is using an unofficial and kind of hack-ish looking script.
Given that new versions are released fairly often and updating is required for an OS upgrade, making upgrading a pretty regular task, it would seem that there would be an easier/smoother way to upgrade. Is there such a way to upgrade? For example, would simply installing another version of command line tools over the previous version be sufficient, cleanly overwriting the previous version? Or is there a way to upgrade through command line?
Any help would be greatly appreciated. Thanks in advance!

Related

How to install Xcode 4 on Mac OS X Mavericks

I can't install Xcode 4. I have some files that I need to open in Xcode 4. However, when I try to install it, it says "Xcode Install Assistant cannot be installed on this disk. The version of OS X is too new." How can I make it think I'm on Lion or Mountain Lion?
Here is a picture:
Download it in the App Store - it's the newest version and looks like the disc you have doesn't support Mavericks.
I feel tired of these preposterous answers. I think that if you want to stick to an older version of something, you should be able to. Also, I don't think software like XCode 4 are that old anyway.
But, to the point: I think XCode 4.6.3 is compatible with Mavericks. I am not sure about previous 4.6.X, but I think none of them work.
Any versions prior would require a previous operating system. I think you could try using pacifist to install the version you want, but I haven't found any guides.
If your problem is with project compatibility, in XCode 5 there is an option to save the project in a way it is compatible with XCode 4.6, and I suppose 4.6 offers a similar option to save in a version prior. Of course, you may need to adapt the code of the projects accordingly. Usually I try to stick with the Snow-Leopard-compatible code, because it compiles fine in all XCode 4.X and 5.X versions.
You can download any of these from the developer website.
I would try partitioning the disk and installing an older Mac OS X. I work with Snow Leopard and Mavericks in the same Mac. I usually do interface tasks in SL and the rest on Mavericks. The other advantage is that I have both XCode 4.2 and 3.2.6 in the same machine, so I can manage some backwards compatibility. =D

Obtaining previous versions of Mac OS X for testing

I'm porting some code to OSX and am in need of some copies of older OSX versions. Does the Mac Developer program allow downloading of previous OSX versions? A few forums mention it, but I've found conflicting/old info on this. It doesn't appear to be here:
https://developer.apple.com/downloads/index.action
I'm also aware of this post Does the Mac Developer Program have old versions of Mac OS X?, but this is now 3 years old. I'm aware some versions can be purchased on Amazon--would rather not go that route though unless necessary. What is the common way to test OSX applications for backwards compatibility?
Thanks!

Upgrading to Mac OS Lion as Developer

I'm planning to buy Mac OS Lion, but I would like to know some informations.
- Are Snow Leopard's apps compatible with Lion?
- Are apps compiled with Xcode for Lion compatible with Snow Leopard? What if these app uses popovers/fullscreen which are features of Lion?
xCode requires a full download (the full 5*ish GB) and if you are a Java guy you will have to re download Java as it is not included (this was my experience when opening eclipse for the first time in Lion).
Some of Snow leopards apps are compatible, not all (ppc apps will not work). It is probably best to check with the software vendor first.
Another thing your Library folder disappears on an upgrade among some others where Lion is trying to 'Protect' its users. To get round this simply enter the command into terminal. (replace username with your username and foldertoreveal with the hidden foldername)
chflags nohidden /Users/Username/FolderToReveal
The upgrade process other wise has been fine. For reference I am an Obj C /C++ /C and Java developer. Hope this helps
Also will link you to this post about Developing Java on Lion:
Stack Overflow post on Java in Lion
A very good list of compatible applications is available at RoaringApps. I highly recommend checking for your favorite editors/IDEs/etc there.
Of note:
TextMate: "Works fine," but there are some issues
BBEdit: "Works fine"
iTerm2: "Works fine" (minor interface bugs)
And of course, Apple's tools require an upgrade to XCode 4.1.
As far as developing with the new APIs in Lion, you can explicitly target a specific version of OS X for compatibility. When building for 10.6, those new APIs will not be exposed during compilation and you will get warnings about unrecognized selectors if you try to use them.
So far what I've noticed :
- make sure you install XCode 4.1 (not the same as 4.0, it's a free separate download), which fixes the Python includes mess
- go to terminal and type "java", this will trigger the download of the Java runtime
But I chose to avoid the burden of fixing all libs by going with a clean install of Lion (from a USB key)
cvs stopped working for me, but downloading Xcode seemed like an unnecessarily heavyweight fix. Adding /Developer/usr/bin to my PATH fixed it for me.

gdb debugger in xcode doesn't work

I'm trying to use direct commands to gdb through xcode's console window when the program is paused. But the (gdb) prompt just accepts the carriage returns, and does nothing. Has anyone encountered this? I'm on the latest version of Mac OS X (10.6.2) with the XCode 3.2 beta.
If using a beta best to contact the beta mailing lists as this is the sort of issue the developers want to know.
If using a beta the first thing I would check is does this work using the previous production version
Also note that you might be under a NDA and so can only discuss with the developers.
This is a bug in the software, or an incompatibility with some setting in my system. Formatting my laptop and reinstalling the software fixed the problem.

GCC without Xcode on OS X

I've just unwrapped my new MacBook Pro (yay!) and am now setting it up properly for development. Since I want to avoid clutter, I'm wondering if I really need to install the Xcode tools at all (I never use the IDE or Mac specific tools), since I'll install a newer version of GCC anyway, using MacPorts.
So, is there any benefit in installing Xcode? Is it necessary? What kind of set-up does it do behind the scenes? Basically: can I skip this or will it come back to haunt me because some Unix development tools just assume that OS X is always set up in this way?
In order to perform an easy and successful install of MacPorts, already having tools from the xCode installer is necessary. You only need the install option that places a copy of the unix/header files outside of xcode; everything else can remain uninstalled.
A friend of mine recently released this:
https://github.com/kennethreitz/osx-gcc-installer
Have fun :)
I tried this trick and I was constantly chasing missing header files and such. Just install XCode.
We primarily use the Xcode IDE for building Cocoa/Carbon applications. Xcode typically has different project templates (and project settings fixed accordingly). As long as you are not going to generate a Universal Binary or a framework I think you should be ok. As far as I am concerned, when I am too pissed with Xcode, I go back to the command line, set up the paths myself and start using GDB.
First of all, congratulations on the new MBP. I recently bought a 15" unibody myself. =)
You can safely skip Xcode installation, and you can install almost everything Xcode installs through MacPorts, except Xcode itself, of course.
However, I believe you'll find yourself installing Xcode one day anyway, and installing Xcode is much easier than installing all the tools (especially GCC) through MacPorts.
You can strip down the Xcode install quite a lot - when you install Xcode there is a "Customise" button where you can remove a lot of stuff (gigabytes worth).
You can also go in and delete stuff from /Developer/, for example the 10.3 SDK is about 150MB (I think), and if you're not writing software for that it's quite safe to delete. Obviously be careful when deleting, but if you break things, you can always reinstall the Developer Tools!
Apple now provides the command line tools as a separate download from Xcode. They work with Lion and Mountain Lion. You can download them from the Apple Developer Center.
(This is noted on the osx-gcc-installer GitHub page.)

Resources