有没有办法在 Xcode 中安装旧版 iOS SDK?
我想通过使用旧的 SDK 编译应用程序来测试新的类和方法,以确保应用程序具有一定的向后兼容性。但是,Xcode 仅适用于最新 iOS 版本的 SDK。
我已经下载并安装了 iOS 3.1.3 SDK (使用此处描述的方法)并且效果很好。我的代码是完整的(不是那么完整:-)) __IPHONE_OS_VERSION_MAX_ALLOWED、__IPHONE_OS_VERSION_MIN_REQUIRED 等respondsToSelector。
这现在适用于 iOS 3.1.3 SDK,但如果将来我想使用 4.0 SDK 重复此过程怎么办?在最新的 Xcode 中安装旧版 SDK 是否有通用流程?
I'd like to ensure some backward compatibility for my apps by compiling them using the older SDKs to test for newer classes and methods. However, Xcode is only available with SDKs for the latest iOS versions.
I've downloaded and installed the iOS 3.1.3 SDK (using the method described here) and that works fine. My code is full (not so full :-) ) of __IPHONE_OS_VERSION_MAX_ALLOWED, __IPHONE_OS_VERSION_MIN_REQUIRED and such respondsToSelector.
This works right now for the iOS 3.1.3 SDK, but what if in the future I wanted to repeat this process with the 4.0 SDK? Is there a general process for installing older SDK versions in the latest Xcode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法在 Xcode 4 上安装旧的 3.1 SDK。您可以将部署目标设置得较低,以允许在运行比当前 SDK 安装更旧的操作系统版本的设备上进行测试。目前,在运行更新版本的 Xcode 时完全确保向后兼容性的唯一方法是保留运行 iOS 3.x 的设备,并在该设备上进行测试。 (...因为据称旧的模拟器/工具有时实际上允许无法在具有相同版本操作系统的实际设备上运行的 API)。
其他方法包括在单独的 Developer_XYZ 目录中安装不同版本的 iOS 开发人员工具,或者保留可启动的 HD 并安装较旧的 iOS 开发人员工具(例如使用 Xcode 3.x 的 Snow Leopard,因为 Lion 可能只支持运行 Xcode 4)。 x)。
You can't install old 3.1 SDKs on Xcode 4. You can set the Deployment target lower to allow testing on devices running older OS versions than your current SDK installation. The only current way to completely ensure backward compatibility, while running more recent versions of Xcode, is to keep a device that runs iOS 3.x, and test on that device. (...because it is claimed that the old Simulators/tools sometimes actually allows APIs that won't run on an actual device with an OS of the same version).
Other methods include installing the different versions of iOS developer tools in a separate Developer_XYZ directories, and or keeping around a bootable HD with the older iOS developer tool installation (say Snow Leopard with Xcode 3.x, since Lion might only support running Xcode 4.x).
无论出于何种原因(我必须这样做来调试 Apple bug),如果您仍然需要将旧版 SDK 安装到现有 Xcode,请按照以下步骤操作:
例子
(/old/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk 到 /new/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs)
For whatever reason (I had to do it to debug an Apple bug), if you still need to install an older SDK to your existing Xcode, follow these steps :
Example
(/old/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk to /new/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs)