Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Bundle Id of your app iOS UIA automation

How do I get the bundle Id of the app I am in ?

like image 234
swathy valluri Avatar asked Jan 05 '12 12:01

swathy valluri


People also ask

What is an iOS bundle ID?

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”.

Is bundle ID visible in app store?

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..


2 Answers

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."

like image 151
Tommy Avatar answered Sep 19 '22 20:09

Tommy


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); 
like image 40
swathy valluri Avatar answered Sep 21 '22 20:09

swathy valluri