We've got a built script for a macOS app that copies a menu extension (.app bundle) via "ditto" which suddenly is throwing a "Operation not permitted" error in Xcode 14 beta 3. We've had no issues since Xcode 10 with the same script (has never changed):
EXTAPP="XXXXXX.com.my.app.ext.app"
if [ $CONFIGURATION == Debug ]
then
EXTAPP="XXXXXX.com.my.app.ext.app-debug.app"
fi
TARGET_LOCATION="${BUILT_PRODUCTS_DIR}/MyApp.app/Contents/Library/LoginItems/${EXTAPP}"
// FAILS HERE:
ditto "${BUILT_PRODUCTS_DIR}/${EXTAPP}" "${TARGET_LOCATION}"
echo "Codesign..."
SHA="${EXPANDED_CODE_SIGN_IDENTITY}"
codesign --preserve-metadata=entitlements --deep --verify --options runtime --force --sign $SHA "${TARGET_LOCATION}"
Seeing this error:
ditto: ...MyApp.app/Contents/Library/LoginItems/XXXXXX.com.my.app.ext.app-debug.app/Contents: Operation not permitted