Skip to content

Instantly share code, notes, and snippets.

@shazron
Last active August 24, 2021 12:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shazron/6093283 to your computer and use it in GitHub Desktop.
Save shazron/6093283 to your computer and use it in GitHub Desktop.
Get the bundle id of an Xcode project. Run this in the same location of your .xcodeproj file
#!/bin/bash
# Run this in the same location as your .xcodeproj file
plutil -convert json -r -o - `xcodebuild -showBuildSettings | grep PRODUCT_SETTINGS_PATH | awk -F ' = ' '{print $2}'` | grep CFBundleIdentifier | awk -F ' : ' '{print $2}' | cut -d'"' -f2
@rondinellimorais
Copy link

Hello,

You can get bundle id
xcodebuild -showBuildSettings | grep PRODUCT_BUNDLE_IDENTIFIER | awk -F ' = ' '{print $2}'

PRODUCT_SETTINGS_PATH can return the value $(PRODUCT_BUNDLE_IDENTIFIER)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment