$ osascript -e 'id of app "<該 app 的名稱>"'
參考:Easily see any app’s bundle identifier | The Robservatory