LoginSignup
12
12

More than 5 years have passed since last update.

Macの資産管理について

Posted at

インストールされているアプリケーションとそのバージョンを取得する

まずはMacにインストールされているアプリケーションのバージョンをターミナルで取得する方法を調査した。

アプリケーションごとに取得する

例:Google Chrome

AppleScript

$ osascript -e 'version of app "Google Chrome"'
41.0.2272.89

defaultsコマンド

$ defaults read /Applications/Google\ Chrome.app/Contents/Info.plist CFBundleShortVersionString
41.0.2272.89

plutilコマンド

$ plutil -p /Applications/Google\ Chrome.app/Contents/Info.plist | grep "CFBundleShortVersionString"
  "CFBundleShortVersionString" => "41.0.2272.89"

インストールされているアプリケーションすべて取得する

システム情報.appにアプリケーションの情報を保持しているので、それをコマンドで表示する。

ターミナルに出力する

$ system_profiler -detailLevel full SPApplicationsDataType

XML形式でファイルとして保存する

拡張子をspxにするとシステム情報.appで開くことができる。

$ system_profiler -xml > ~/report.spx -detailLevel full SPApplicationsDataType

XMLで保存しておけばプログラムで処理しやすい。

12
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
12