Ways to fetch bundleId for IOS apps as appium capability

qavbox by sunil
3 min readMar 21, 2023

Mobile device has many applications, so we should let appium know on which application automated tests should run.

For this appium provides capability bundleID to identify the iOS application on device.

Most of the applications we do automation are from with in the organisation, bundleID from the dev team.

but if in case the dev team is not present in same organisation or you are practicing any public applications, then we do have other ways to fetch these capabilities.

bundleID for iOS apps –

Method 1 –

iOS apps can be of file extension .app or .ipa

If you have .app file, then get the path of the .app file from local drive, then run the following command to fetch bundleID

osascript -e 'id of app "[.app file name with path]"'

Method 2 –

If you are looking for bundleID of apps from apple app store, then follow as below

https://itunes.apple.com/lookup?id=1069512615

“bundleId”:”com.apple.MobileAddressBook”

Method 3

From the .ipa file itself –

If you have downloaded the .ipa file from some source, then

  • Rename the .ipa to .zip (let’s say myApp.zip)
  • Extract the zip file > you will get myApp.app file
  • Right click on the myApp.app file > Show Package Contents > open the info.plist file in xcode
  • Open the search (Command + f) > search for “Bundle Identifier” to get the bundleId

In the 2nd image from below, you should see the bundleId — com.saucelabs.mydemoapp.rn

From the .app file itself –

If you have .app file, then

  • Right click on the application (let’s say myApp.app file) > Show Package Contents
  • Open the info.plist file in xcode
  • Open the search (Command + f) > search for “Bundle Identifier” to get the bundleId

Method 4

If app installed in devices but not yet in app store [not yet released, may be in development]

For example, in my simulator, UIcatalog app installed, but not in app store

  • Launch the simulator or connect real device with app installed to MAC computer
  • On Mac, launch the Console [from spotlight search]
  • On left side, select your device name, and search for the app name to get the bundleID [screenshot below]

com.example.apple-samplecode.UICatalog

Follow qavbox for more such topics.

You can find automation testing topics on

my blog — https://qavalidation.com/

watch the testing topics — https://www.youtube.com/c/qavbox

--

--