Fixed link to the latest archive of Xcode


When using Xcode, I always want to the latest archive to be in a fixed position, for example, to build the installation package or make a new deployment.

Here’s a script

latest_archive_folder=$HOME/Library/Developer/Xcode/Archives/latest
mkdir -p $latest_archive_folder
rm -fr "$latest_archive_folder/$PROJECT_NAME"
ln -s "$ARCHIVE_PATH" "$latest_archive_folder/$PROJECT_NAME"

Put it in the Post-actions of the Archive in Scheme. Every time an archive is generated, the script generates a link with the project name in $HOME/Library/Developer/Xcode/Archives/latest/.