How to Uninstall Xcode

How to Uninstall Xcode – faral的专栏 – 博客频道

A friend in San Francisco, Rodney Aiglstorfer, was recently jumping through hoops to get Xcode to cooperate with his iPhone. There’s nothing more aggravating than having your application running within the simulator and getting stuck downloading to a device.

At one point in the process he opted to remove the Xcode developer tools and start the configuration from the beginning. Which leads to the tip: should you ever find the need to remove Xcode, run the following from within a terminal window to make it happen:

  1. sudo <Xcode>/Library/uninstall-devtools –mode=all  
sudo <Xcode>/Library/uninstall-devtools --mode=all

sudo /Developer/Library/uninstall-developer-folder 

<Xcode> is the directory where the tools are installed. For typical installations the full path is /Developer/Library/uninstall-devtools

Easy enough, just make sure this is what you really intend to do as once it’s gone, it’s gone.

//————-

http://macdevelopertips.com/xcode/how-to-uninstall-xcode.html

===========================================================

1、卸载之前的XCode

命令行执行下面命令:

sudo /Developer/Library/uninstall-devtools –mode=all 
sudo /Developer/Library/uninstall-developer-folders

参看:

http://www.cocoachina.com/bbs/read.php?tid-17767.html

http://macdevelopertips.com/xcode/how-to-uninstall-xcode.html

经过试验,AppCleaner 并不能卸载干净,我是在AppCleaner之后再执行 sudo /Developer/Library/uninstall-devtools –mode=all 命令,然后手工删除 /Developer 目录完成卸载的。

2、App Store 上提示XCode“已有更新可用于其他账户”

上面卸载完成后,由于之前我安装的XCode4.1 是从别人那里直接Copy过来的安装文件,我的AppStore上打开XCode时,提醒我“已有更新可用于其他账户”

image

但是我明明以上用上面命令把XCode删除了呀。

经过搜索和分析,发现是 Spotlight 在捣鬼,文件和目录删除了,但是索引文件没有被更新。

依次执行下面命令:

cd /System/Library/LaunchDaemonssudo launchctl unload -w com.apple.metadata.mds.plist等待半个小时左右;再继续执行下面命令sudo launchctl load -w com.apple.metadata.mds.plist

第二步的命令是 停止和停用Spotlight 后台服务; 第4步的命令重新启用Spotlight 后台服务 。中间必须有足够长的时间间隔,我在之前试过间隔2分钟,结果没有效果。

这项卸载完成后, 在 App Store 的更新中就不会看到 XCode 了。

参看:

如何关闭Spotlight 
http://drawsimin.blog.163.com/blog/static/1451336820090296572522/

3、App Store 显示 XCode 已安装的问题

步骤2执行后,App Store 的更新中是看不到 XCode, 但是打开 XCode 会提醒已安装,见鬼了。

通过查找及分析,发现是因为 App Store 其实是给的你 Install Xcode, 我之前装的 Xcode 4.1 的安装文件还是在本子上,把这个安装文件删除,重新打开 App Store就可以下载 XCode 4.2 了。

你可以通过搜索找到之前 XCode 的安装文件是放在那个目录下了。

参看:

一波三折的装上了xcode4.1 
http://www.douban.com/group/topic/21353623/

上面三个步骤完成后,重新打开App Store 就可以下载 XCode 4.2 了。

//—-

http://qing.weibo.com/1400770593/537e10213300063c.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s