简体   繁体   中英

Listing all programs installed on Mac using Java

How can I list all the installed programs on Mac OS, date of installation and version using Java?

For example, on Windows I use wmic get product name, version, InstallDate .

You can create a dump of all the applications registered with Launch Services using,

    lsregister -dump

Execute this command through your java applications and read the dump file to get the app names.

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump

or

ls -hal /Applications/
grep -i CFBundleShortVersionString -A 1 /Applications/Mail.app/Contents/Info.plist 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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