Skip to content

Instantly share code, notes, and snippets.

@insidegui
Created August 12, 2022 21:20
Show Gist options
  • Save insidegui/1275b0e81bb7b5a525368d55ecc96e2c to your computer and use it in GitHub Desktop.
Save insidegui/1275b0e81bb7b5a525368d55ecc96e2c to your computer and use it in GitHub Desktop.
Fixes missing HomeKit entitlement when building for Mac Catalyst on Xcode 14
if [ "$EFFECTIVE_PLATFORM_NAME" = "-maccatalyst" ]; then
echo "Adding com.apple.developer.homekit entitlement"
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.homekit bool true" "$TARGET_TEMP_DIR/$FULL_PRODUCT_NAME.xcent"
fi
@pvieito
Copy link

pvieito commented Sep 1, 2022

To avoid breaking builds with other Xcode versions:

if [ "$EFFECTIVE_PLATFORM_NAME" = "-maccatalyst" ] && [ "$XCODE_VERSION_MAJOR" = "1400" ]; then
    echo "Adding com.apple.developer.homekit entitlement"
    /usr/libexec/PlistBuddy -c "Add :com.apple.developer.homekit bool true" "$TARGET_TEMP_DIR/$FULL_PRODUCT_NAME.xcent"
fi

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