Reputation: 5277
How do I get the bundle Id of the app I am in ?
Upvotes: 39
Views: 37149
Reputation: 97
You can findle the bundle id from the plist. Right Click in the app file and click on "show package contents". You will find a plist file there. Open it with any text editor and you will get the bundle id.
Upvotes: 4
Reputation: 5277
Here is how I got the Bundle Id for my APP in the UIA Scripts:
//code to get bundle id
var target = UIATarget.localTarget();
var app_name = target.frontMostApp().bundleID();
UIALogger.logDebug(app_name);
Upvotes: 8
Reputation: 100602
You'd use:
[[NSBundle mainBundle] bundleIdentifier]
+ mainBundle
"[r]eturns the NSBundle object that corresponds to the directory where the current application executable is located." and hence will return an NSBundle
object for the application bundle.
[- bundleIdentifier
] Returns "[t]he receiver’s bundle identifier, which is defined by the CFBundleIdentifier key in the bundle’s information property list."
Upvotes: 118