I was able to get bundle identifiers for all apps installed on iOS simulator by going to directory
~/Library/Developer/CoreSimulator/Devices/[DeviceID]/data/Containers/Data/Application/
but how do I know which app the ID belongs to? Are there names? Why are all IDs numerical? Are they randomly generated and different on each sim?
I don't know why it is random number. Why apple use this kind of mechanism, But you can get application bundle identifier by using below step.
Step:1
Goto:
~/Library/Developer/CoreSimulator/Devices/[DeviceID]/data/Containers/Data/Application/
Step:2
Select Any application > Open
.com.apple.mobile_container_manager.metadata.plist
file.Step:3 Value for
MCMMetadataIdentifier
is identifier for your application you can also see in below screenshot.