How to Completely Uninstall Xcode

I hit a really odd bug last night. I mean, really, really odd. One of those bugs that keeps you up until 4am and you go to bed defeated. I came into the office today and had another engineer sit with me as I went through my code explaining what I was doing hoping that a second set eyes and another brain could bring some clarity.

No luck.

Everything looked good, but this very odd crash was still occurring. We were both scratching our heads. The weird part was that the program ran perfectly on the iPhone and in the simulator, as long as I didn’t have the debugger attached. The other engineer tried the build on his machine and everything worked as it should and he was able to run the Xcode debugger.

I decided to completely remove and reinstall Xcode and the iPhone SDK. Normally, you just drag a Mac application to the Trash Can and you’re good. Xcode is a little different. There’s a ton of different folders, tools, SDKs, simulators, etc scattered around the Hard Drive.

So how do you remove everything?

Fire up Terminal and type:

sudo /Developer/Library/uninstall-devtools -mode=all

Type in your password and go grab a coffee. The Uninstall process takes quite a bit of time as it analyzes every package on your machine. However, it will find and remove all Xcode and iPhone SDK components. I highly recommend you to restart your Mac before re-installing Xcode.

About the author

Terry Blanchard

I'm the Vice President of Engineering at Readdle, ex-Apple, design evangelist, drummer, and gadget junkie extraordinaire.

11 thoughts on “How to Completely Uninstall Xcode”

  1. Hi,

    To uninstall the Xcode I entered the required “sudo” string , and the system asked me the password.I entered my Apple ID(password)-the system didn’t accept it. It looks like the system wants the administrator’s pasword.
    I’ve bought a used Macbook. How to get the password.

    What password have I to enter?

    Thank you.
    Vlad.

  2. hi had a snow lepord and was using xcode 3 but recently i update to lion and was trying to unistall xcode 3 and intall 4 i got error message.
    once i type
    sudo /path/to/xcode/library/unistall-devtools–mode=all
    in the terminal it asked for password and when i enter the admin password it says command not found.
    can anyone help me please how to unistall xcode 3 on lion..

  3. Hi Ishwor,

    It looks like you’ve typed the command incorrectly. Two things:

    1. You have “unistall” instead of “uninstall”
    2. There is a space between “devtools” and “-mode”

    Hope that helps!
    // Terry.

  4. Hi would you mind stating which blog platform you’re working with? I’m planning
    to start my own blog in the near future but I’m having a hard time choosing between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then most blogs and I’m looking for something unique.
    P.S Apologies for being off-topic but I had to ask!

Leave a Reply

Your email address will not be published. Required fields are marked *