检测应用程序正在使用什么框架

发布于 2024-10-16 00:23:23 字数 158 浏览 3 评论 0原文

我正在寻找检测应用程序正在使用的框架的方法。

例如,假设某个 XYZ 应用程序使用 Carbon 框架和 Cocoa 框架,那么我的程序应该能够检测到该 XYZ 应用程序使用 Carbon 框架和 Cocoa 框架。

任何帮助将不胜感激。

谢谢, 拉胡尔

I am looking at way of detecting what frameworks application is using.

For example, say some XYZ application uses carbon framework and cocoa framework, then my program should be able to detect that this XYZ application makes use of carbon framework and cocoa framework.

Any help would be highly appreciated.

Thanks,
Rahul

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独自唱情﹋歌 2024-10-23 00:23:23

最简单的方法是在应用程序二进制文件上运行otool -L。例如,

$ otool -L /Applications/Twitter.app/Contents/MacOS/Twitter | grep Frameworks
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 15.0.0)
    /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.6.2)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 37594.0.0)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 152.0.0)
    /System/Library/Frameworks/QTKit.framework/Versions/A/QTKit (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit (compatibility version 1.0.0, current version 533.16.0)
    /System/Library/Frameworks/CoreLocation.framework/Versions/A/CoreLocation (compatibility version 1.0.0, current version 12.0.0)
    @executable_path/../Frameworks/Growl.framework/Versions/A/Growl (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 44.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.29.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 38.0.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 751.29.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1038.32.0)

如果由于某种原因无法运行 otool,您可以随时阅读 其源代码并按照其许可证

The easiest way is to run otool -L on the application binary. For instance,

$ otool -L /Applications/Twitter.app/Contents/MacOS/Twitter | grep Frameworks
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 15.0.0)
    /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.6.2)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 37594.0.0)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 152.0.0)
    /System/Library/Frameworks/QTKit.framework/Versions/A/QTKit (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit (compatibility version 1.0.0, current version 533.16.0)
    /System/Library/Frameworks/CoreLocation.framework/Versions/A/CoreLocation (compatibility version 1.0.0, current version 12.0.0)
    @executable_path/../Frameworks/Growl.framework/Versions/A/Growl (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 44.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.29.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 38.0.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 751.29.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1038.32.0)

If you cannot run otool for some reason, you can always read its source code and use it according to its licence.

一抹淡然 2024-10-23 00:23:23

您可以将输出解析为 lsof,或者您可以转到 浏览lsof的来源并复制相关代码到您自己的应用程序中。

You could parse the output to lsof, or you could go browse the sources of lsof and copy the relevant code into your own app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文