Xcode Run Script NOT For Catalyst

Viewed 403

enter image description here

I have a run script that is only for iOS and I do not want it to be run when I build for Mac Catalyst. Is there conditional code I can add into the run script to check this?

Xcode 11.5

2 Answers

I figured it out, and it was quite simple:

if [ "${TARGET_OS_MACCATALYST}" = "1" ]; then
bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/ZSS.framework/strip-frameworks.sh"
fi

Nic Hubbard found a solution to his own question. Another way to solve this is by adding another target to the project for the Mac specific version of the app. This target can be a copy of the original iOS app target with the script removed.

This would increase the complexity of maintaining this project going forward. When you add something to the project you have to make sure it is added to both targets. You would also have to ensure the iOS and Mac apps are built with the correct targets.

Related