CFBundleIdentifierを探す
Karabiner の設定をするのに、UTI文字列が必要なのでね。com.vivaldi.Vivaldi
のような文字列が必要になるので。
plutil -extract CFBundleIdentifier xml1 path/to/Info.plist -o - | xmllint - --xpath "//string/text()"
CFBundleIdentifier は UTI文字列 を入れている。
UTI 文字列を identifier (識別子)として使うので、例えば、次のようになる。
takuya@~$ plutil -extract CFBundleIdentifier xml1 /Applications/PhpStorm.app/Contents/Info.plist -o - | xmllint - --xpath "//string/text()" <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <string>com.jetbrains.PhpStorm</string> </plist>
/Applications からすべてのIDを探すなら、
ループで回せば結構簡単にわかってくる。
for i in /Applications/*/Contents/Info.plist; do plutil -extract CFBundleIdentifier xml1 "$i" -o - | xmllint - --xpath "//string/text()"; done \ | grep string
参考資料
http://www15.plala.or.jp/NovemberKou/documentBasedProject/setCFBundleIdentifier.html
http://harafuji0613.hatenablog.com/entry/2015/03/22/002953
http://qiita.com/trakwkbys/items/a94c4d43342e96352bde
2017-07-21 追記
セルフ検索に引っかからないので、キーワード追加した