As the variation on option 2 suggested here, one can use a Run Script Phase. The cons is that it will be dynamically switch to the run destination runtime (unless run without build is used with a different run destination).
if [ $XCODE_VERSION_ACTUAL -gt 1640 ]; then
echo >&2 "error: time to remove 'libswiftWebKit' patch"
exit 1
fi
DYLD_FALLBACK_LIBRARY_PATH=$(xcrun simctl list devices -v | awk -v device_uuid=$TARGET_DEVICE_IDENTIFIER '/^--/ { RUNTIME=$0 } $0 ~ device_uuid { print RUNTIME }' | sed -E 's/.*\[(.*)\].*/\1/')
DYLD_FALLBACK_LIBRARY_PATH="$DYLD_FALLBACK_LIBRARY_PATH/Contents/Resources/RuntimeRoot/System/Cryptexes/OS/usr/lib/swift"
ln -sf "$DYLD_FALLBACK_LIBRARY_PATH/libswiftWebKit.dylib" "$BUILT_PRODUCTS_DIR/libswiftWebKit.dylib"
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: