Apple App Store 提交,除了 Apple 之外还有其他人对非公共 API 的使用进行自动化测试吗?
苹果显然以某种方式实现了自动化,我想访问他们正在使用的系统版本。
除此之外,我很想知道是否有人自己实现了这个。有时,我在一个团队中工作,经验不足的开发人员可能会在不知情的情况下使用非公共 API或者,我可能会被要求使用我不知道的第三方库,而该库正在使用非公共 API。民众。
我知道可以扫描应用程序可执行文件的方法名称。我想针对已知非公共方法或公共方法的数据库运行这些方法。在 Objective-C/SQL 中,该过程的一部分可能是这样的:
for (NSString *selector in methodsArray) {
NSArray *array = [DataSource arrayWithQueryString:[NSString stringWithFormat:(SELECT `selectors` FROM `publicAPI` WHERE `selector` = '%@'),selector]];
BOOL public = ([array count] > 0);
if (!public)
return NO;
}
我的猜测是,大部分工作将是如何隔离方法名称并将它们存储在数据库中,以便对它们进行检查将是最有效的。
我可以自己创建一个版本,但如果有人已经完成了它,我有兴趣了解它,并且我不在乎它是用什么语言实现的。
Apple clearly has this automated in some way, I would like to have access to a version of the system they're using.
Barring that, I'm interested in knowing if anyone out there has implemented a this on their own. I sometimes work in a team where the lesser experienced developers may unknowingly use a non-public API or I may be asked to use a third-party library that unbeknownst to me is using an API that is non-public.
I know that the app executable can be scanned for the method names. I'd like to run those against a database of either the known non-public methods or against the public ones. In Objective-C/SQL part of the process might be like:
for (NSString *selector in methodsArray) {
NSArray *array = [DataSource arrayWithQueryString:[NSString stringWithFormat:(SELECT `selectors` FROM `publicAPI` WHERE `selector` = '%@'),selector]];
BOOL public = ([array count] > 0);
if (!public)
return NO;
}
My guess is most of the work would be in how to isolate the method names and store them in the database in a way that checking against them would be most efficient.
I could create a version of this myself but if there's someone who's already done it, I'm interested in knowing about it, and I don't care what language it's achieved in.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有这个,App Scanner http://www.chimpstudios.com/appscanner/
there's this one, App Scanner http://www.chimpstudios.com/appscanner/
如果您调用的 API 不在 Apple 公共标头之一中,您将收到编译器警告,例如“选择器无法识别”。您意外使用私有 API 的情况应该很少见。
现在,如果您采取特定步骤,则可以抑制编译器警告 - 例如,为包含私有 API 方法声明的对象创建您自己的接口。如果您的团队中有流氓开发人员,或者您继承了代码,类似的事情可能会让您感到惊讶。
如果您使用的是 GTM iPhone 测试套件等测试框架(它使用私有 API 调用),您还必须小心。如果它不小心被编译到您提交的二进制文件中,您就会陷入困境。 Xcode 4 有助于减轻这种风险,因为在新 IDE 中进行测试是一个完全独立的操作,而不仅仅是一个单独的目标。
If you're calling an API that isn't in one of Apple's public headers, you'll get compiler warnings like "selector not recognized". It should be quite rare that you would accidentally use private APIs.
Now, it's possible to suppress the compiler warnings if you take specific steps to do so— creating your own interface to an object containing declarations of the private API methods, for example. If you've got a rogue developer on your team, or you're inheriting code, something like that might catch you by surprise.
You also have to be careful if you're using a testing framework like the GTM iPhone test kit, which uses private API calls. If it accidentally gets compiled into your submitted binary, you'll get dinged. Xcode 4 helps mitigate this risk because testing in the new IDE is a whole separate action, not just a separate target.