Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Bundle ID of Mac application?

I want to use Python and atomac module to trigger an application in macOS like following scripts:

atomac.launchAppByBundleID()
app_win = atomac.getAppRefByBundleId(app_bundle_ID)

But I don't know how to get the Bundle ID (app_bundle_ID) of the application.

like image 895
Qing Avatar asked Sep 13 '16 07:09

Qing


People also ask

What is the bundle ID of my app?

What is an iOS App Bundle ID ? Bundle ID is an identifier for each app published on App Store and set when creating an app. Every iOS application requires a bundle ID to work and it needs to be unique if the developer wants to publish it on App Store.

How do I find my bundle ID XCode?

Open you project with XCode, select the top project item in the project navigator at the left. Then select TARGETS -> General. Bundle Identifier is found under Identity.


2 Answers

I use two methods to get the bundler ID:

osascript -e 'id of app "SomeApp"'

and

mdls -name kMDItemCFBundleIdentifier -r SomeApp.app
like image 102
Qing Avatar answered Oct 03 '22 01:10

Qing


if you just need it to launch the app look in the app's info.plist file. the file is in the app bundle in the Contents directory. This works for a lot of apps.

like image 34
Yup Avatar answered Oct 03 '22 01:10

Yup