Skip to content

Instantly share code, notes, and snippets.

@adityadaniel
Created November 7, 2025 08:44
Show Gist options
  • Select an option

  • Save adityadaniel/c865a9cc0267d43d4efe2da0703a1337 to your computer and use it in GitHub Desktop.

Select an option

Save adityadaniel/c865a9cc0267d43d4efe2da0703a1337 to your computer and use it in GitHub Desktop.
python xcframework codesign
#!/bin/sh
set -e
echo "======================================"
echo "Signing Python Framework and Libraries"
echo "======================================"
# Only sign for non-simulator builds
if [[ "${PLATFORM_NAME}" == *"simulator"* ]]; then
echo "Skipping signing for simulator build"
exit 0
fi
# Check if we have a signing identity
if [ -z "$EXPANDED_CODE_SIGN_IDENTITY" ]; then
echo "No signing identity found, skipping signing"
exit 0
fi
echo "Signing as $EXPANDED_CODE_SIGN_IDENTITY_NAME ($EXPANDED_CODE_SIGN_IDENTITY)"
# Sign the main Python framework
PYTHON_FRAMEWORK="$CODESIGNING_FOLDER_PATH/Contents/Frameworks/Python.framework"
if [ -d "$PYTHON_FRAMEWORK" ]; then
echo "Signing Python.framework..."
/usr/bin/codesign --force --deep --sign "$EXPANDED_CODE_SIGN_IDENTITY" \
--options runtime \
--timestamp \
"$PYTHON_FRAMEWORK"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment