如何在Xcode 4.5中添加旧版iOS SDK

sin*_*pec 37 sdk xcode ios

我在这里复制了iOS 5.1 SDK:

应用程序/ Xcode.app /内容/开发/平台/ iPhoneOS.platform /开发商/软件开发工具包

但是,我仍然无法在Xcode中选择基础SDK.有人可以帮忙吗?

Gur*_*uru 57

您需要将iPhoneOS5.1.sdk复制到该目录

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
Run Code Online (Sandbox Code Playgroud)

和iPhoneSimulator5.1.sdk到

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk
Run Code Online (Sandbox Code Playgroud)

(您需要重新启动Xcode才能在Base SDK构建选项中选择SDK.)

  • 从哪里复制iPhoneOS5.1.sdk和iPhoneSimulator5.1.sdk?谢谢. (3认同)
  • 也可以用同样的方式添加ios4.3,ios5,ios5.1等 (2认同)

Mar*_*rku 49

以上都不适用于我的10.8 xcode 4.5.1.找不到上面给出的大多数路径.

这是我的解决方案说明.

  1. https://developer.apple.com/downloads/下载xcode_4.4.1_6938145.dmg
  2. 加载dmg文件然后转到Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs /你会发现iPhoneOS5.1.sdk(在这种情况下这就是我想要的).
  3. 将iPhoneOS5.1.sdk文件夹复制到Xcode文件夹/Applications/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
  4. 重启Xcode
  5. 打开Xcode项目设置 - >构建设置 - >基础SDK,然后你会看到iOS 5.1选项.

  • 这工作,应该是正确的答案!在这里下载旧版本的xcode https://developer.apple.com/downloads/index.action#(当然需要一个开发者帐户) (5认同)
  • 在步骤2和3.我必须右键单击Xco​​de图标并单击Show Package Contents才能转到Contents/Developer ....(仅适用于OSX中的新手) (2认同)