我如何发现使用Objective C或Macruby在OS X上安装了哪些应用程序? [英] How can I discover what apps are installed on OS X using Objective C or Macruby?
问题描述
您能告诉我-我可以使用哪个对象和哪种方法来获取有关使用目标c或macruby在OSX上安装的应用程序的信息?
could you tell me please - which object and which method can i use to fetch information about installed applications on OSX with objective c or macruby?
推荐答案
如果要列出所有GUI应用程序,则可以使用参考.
If you meant to list all of GUI apps, you can use Launch Services. For the list of functions, see the reference.
请勿手动列出 .app
捆绑包!!系统已完成此操作,您只需要查询即可.
在
Do not manually list .app
bundles! It's already done by the system, and you just have to query it.
There is a command-line program called lsregister
at
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister
可用于获取启动服务数据库的详细转储.该工具有时会很有帮助, 但不要在运输程序中依赖它,
which can be used to get the detailed dump of the Launch Service database. This tool is sometimes helpful, but don't depend on that in a shipping program,
这篇关于我如何发现使用Objective C或Macruby在OS X上安装了哪些应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!