如何在Mac上获取已安装应用程序的列表 [英] How to get list of installed applications on mac
问题描述
我需要获取豹/雪豹上已安装的应用程序的列表.谁能建议我如何使用可可应用程序获取安装的应用程序列表.
I need to get list of installed applications on leopard / snow leopard. Can any one suggest me how I can get list of installed apps using my cocoa application.
我尝试使用"system_profiler SPApplicationsDataType".问题在于它只列出了* .app文件,其中也包括驱动程序.有没有办法只获取已安装的应用程序"列表.
I have tried using "system_profiler SPApplicationsDataType". Problem with this is it just lists out *.app files, which includes the drivers as well. Is there a way to get only list of "installed apps".
推荐答案
您也许可以使用system_profiler -xml SPApplicationsDataType
,然后解析生成的XML数据,以仅获取您感兴趣的应用程序.
You might be able use to use system_profiler -xml SPApplicationsDataType
and then parse the resulting XML data to get just the applications that you are interested in.
这篇关于如何在Mac上获取已安装应用程序的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!