5

How do I get the bundle identifiers of all the apps installed on an iOS simulator?

I want to automate uninstallation of a specific app called WebDriverAgent (used by Appium) via a script.

e.g.

xcrun simctl uninstall booted com.example.apple-samplecode.UICatalog
3
  • I have the same exact need, for the same exact goal 😃 Did you manage to find a way? In Xcode AppleScript I manage to get current scheme, but the only thing I can get is its name or its ID (but not Bundle ID…).
    – AnthoPak
    Feb 27, 2020 at 12:59
  • Don't remember if I did or not, but I think the bundle ID might be in a configuration file that each app has, so maybe use grep or find to get an array of those files, then parse the bundle ID from the file, I think maybe the file was called plist but not sure.
    – the_prole
    Feb 28, 2020 at 0:41
  • Thanks for the answer. The issue is that in Info.plist, it just references $(PRODUCT_BUNDLE_IDENTIFIER). I ended up using this command gist.github.com/shazron/6093283#gistcomment-2360716 instead, and it works well :)
    – AnthoPak
    Mar 2, 2020 at 15:46

3 Answers 3

11
xcrun simctl listapps {DEVICE_UUID}

Will list all of the installed applications on the Simulator

3
  • 2
    To find the device UUID, you could use xcrun simctl list devices --json
    – Mehrad
    Jan 24, 2022 at 9:15
  • perfect answer! Apr 4, 2022 at 19:34
  • 2
    You can also uses the special identifier booted to specify the device. So xcrun simctl listapps booted Jun 7, 2022 at 22:06
3

for simulator

ideviceinstaller -l -o list_all

for real devices

ideviceinstaller -u <UDID> -l -o list_all
1

Apps are installed in this directory: ~/Library/Developer/CoreSimulator/Devices/[DeviceID]/data/Containers/Data/Application/ [DeviceID] being the simulator's UDID you are using. Every time a new app installed a new directory is created.

I bet your WebDriverAgent lies in there and can be removed.

8
  • I was able to use useNewWDA=true capability
    – the_prole
    May 4, 2018 at 22:21
  • Nice! Great you figured it out yourself. Maybe you can explain it a bit more in detail for future readers that have the same problem :)
    – palme
    May 5, 2018 at 6:25
  • Only problem is these ids don't have names, they are just numbers. How to know which app they belong to?
    – the_prole
    May 18, 2018 at 3:34
  • Are these bundle identifiers? What are they?
    – the_prole
    May 18, 2018 at 4:08
  • One is the device-id for the device, the other one seems to be a random identifier for your application. It is not the bundle identifier, this most of the time follows this reverse domain structure, e.g. com.the_prole.myapplication
    – palme
    May 19, 2018 at 5:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.