I am using Receigen check for Apple. I integrated the script into my build process, which generates the appropriate files for my project:
# Receigen binary RECEIGEN="/Applications/Receigen.app/Contents/MacOS/Receigen" # Extract Info.plist information INPUT="$INFOPLIST_FILE" BUNDLE_ID=`/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "$INPUT"` BUNDLE_VERSION=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INPUT"` # Expand information if needed EXPANDED_BUNDLE_ID=`eval "echo $BUNDLE_ID"` EXPANDED_BUNDLE_VERSION=`eval "echo $BUNDLE_VERSION"` # Make sure the destination directory exists mkdir -p "$DERIVED_FILES_DIR" HEADER="$DERIVED_FILES_DIR/receiptCheck.h" # Check if the generation is needed if [ -e "$HEADER" ]; then SKIP=`grep -q "$EXPANDED_BUNDLE_ID" "$HEADER" && grep -q "$EXPANDED_BUNDLE_VERSION" "$HEADER" && echo "YES"` fi # Generate the header file if needed if [ "x$SKIP" = "x" ]; then "$RECEIGEN" --identifier "$EXPANDED_BUNDLE_ID" --version "$EXPANDED_BUNDLE_VERSION" --failure 'exitwith173' --success 'runapplication' --os osx > "$HEADER" fi
The problem with Xcode 7 is related to this line:
BUNDLE_ID=`/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "$INPUT"`
Since the BundleID of the new Xcode is in the build settings instead of Info.plist, I believe that the key in the build settings is $ (PRODUCT_BUNDLE_IDENTIFIER)
Is there a way to extract the bundle id from build settings on a script?
source share