Cook on Mac keeps crashing

I’m trying to automate the build process with Jenkins for a game built on Mac.

But the cook process keeps crashing, hanging the automation tools.

We’re using this bash script to run the actual cook:

if [[ $# -eq 2 ]]; then
	echo "Cooking for targets:  $1"
	echo "Cooking maps:  $2"
    for i in 1 2 3; do
        $SPIDER_ENGINE_PATH/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor $SPIDER_PROJECT -run=cook -unattended -targetplatform=$1 -iterate -map=$2 && break
    done
    exit $?
fi

And getting this error (screenshot from remote machine):