我试图为Xcode的应用版本更新此内容。这将展示如何安装具有完整gcc支持的Xcode 4.4.x。
你需要:Mac OSX Lion - 这很重要,请勿尝试使用Mountain Lion!
你需要:Lion的Xcode 4.1副本。从Apple下载并使用dev帐户。不要立即安装。
现在通过Mac App Store从Apple安装Xcode 4.4.x。
完成后,你将在应用程序目录中拥有xcode 4.4.x。
根据用户权限,你将不得不使用管理员密码确认许多操作。只有在必要时才执行。如果你损坏了系统,你就自己负责(尽管不应该发生,因为Xcode已经被应用化了)。
通过右键单击“显示包内容”,然后导航到此处的gcc 4.2插件打开Xcode 4.4.x:
/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.2.xcplugin/Contents/Resources/
使用文本编辑器打开文件gcc 4.2.xcspec。
请查看第41行和第42行。确保它们的显示与此处完全相同(在新安装中,这些值将被颠倒)。
ShowInCompilerSelectionPopup = YES;
IsNoLongerSupported = NO;
保存并关闭。
为Lion安装Xcode 4.1。
现在导航到您启动驱动器根目录的开发人员目录。
导航到/ Developer / Platforms / iPhoneOS.platform / Developer / usr /
使用command-c复制usr目录
切换回xcode 4.4.x
导航到:/ Applications / Xcode.app / Contents / Developer / Platforms / iPhoneOS.platform / Developer /
使用command-v粘贴usr目录
现在,Lion将尝试合并这两个目录。确保按“保留更新的文件”
重复源:/ Developer / Platforms / iPhoneSimulator.platform / Developer / usr和目标:/Applications/Xcode.app/Contents/Developer/Platforms/usr
再次合并并“保留更新的文件”
导航到:/ Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS4.3.sdk / usr / lib
现在通过选择它并使用command-c复制gcc目录
导航到Xcode 4.4.x应用程序:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib
使用命令-v将gcc目录粘贴
从/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib开始,重复操作直到'info'目录
目标再次是/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib
完成。启动Xcode并在必要的设置中选择GCC 4.2。您应该删除过时的“Developer”目录。
Xcode现在也应该能够通过Mac App Store接受更新(这还需要测试)。我也没有下载命令行工具,但我猜它也会生效。