简体   繁体   English

检查 iPhone 应用程序中使用的 SDK 方法

[英]Check SDK methods used in an iPhone app

As Apple adds new APIs and new methods to APIs with every new iOS update or release and given that nowadays you can't even test on an iOS 3.x simulator, is there any way to test your iPhone app in older SDKs or to know what SDK level you are using through it?随着 Apple 在每次新的 iOS 更新或发布时向 API 添加新的 API 和新方法,并且鉴于现在您甚至无法在 iOS 3.x 模拟器上进行测试,有没有办法在旧的 SDK 中测试您的 iPhone 应用程序或知道你用的是什么SDK级别的呢?

Downgrading to an old Xcode with a 3.x simulator is not an option and, well, there are tons of methods introduced in, say, 4.2.使用 3.x 模拟器降级到旧的 Xcode 不是一种选择,而且,在 4.2 中引入了很多方法。

Has any one come up with a lib, script, tool, anything, that analyzes the code to show API usage?有没有人想出一个库、脚本、工具等任何东西来分析代码以显示 API 的用法?

The way most iOS developers do this is to keep around an old 1st or 2nd generation iPod Touch (or other old iPhone device) that hasn't been updated past the oldest iPhone OS version that they plan on supporting with their Deployment Target setting.大多数 iOS 开发人员这样做的方式是保留旧的第一代或第二代 iPod Touch(或其他旧的 iPhone 设备),这些设备尚未更新到他们计划通过部署目标设置支持的最旧 iPhone 操作系统版本。

A cheap used iOS device, even with a scratched/cracked display or mostly dead battery, from eBay (et.al. or some neighbor or nephew who upgraded), might work.便宜的二手 iOS 设备,即使显示屏有划痕/破裂或大部分电池没电,来自 eBay(等人或升级的某些邻居或侄子)也可能工作。

Testing on an old device is actually a better and more accurate check than just testing with the Simulator, as the Simulator for various SDK versions supported APIs that the device at that OS level did not.在旧设备上进行测试实际上比仅使用模拟器测试更好、更准确,因为各种 SDK 版本的模拟器支持该操作系统级别的设备不支持的 API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM