How do I get the bundle Id of the app I am in ?
What is a Bundle or Application ID? In the Apple App Store, the Bundle ID serves as a resource that represents the app's unique identifier that you can register, modify, and delete. It allows you to connect third-party services offered by Apple such as “Health, Apple Pay and In-App Purchases”.
It will not be displayed in the app store.. Only the App ID will be displayed in the URL. And that will not change for a app. You can even have a different App name and Bundle Identifier..
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."
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With