Skip to content

Instantly share code, notes, and snippets.

@mahdyar
Last active March 1, 2021 14:46
Show Gist options
  • Save mahdyar/e72758d4a7a850cb001e75b5b0c5f143 to your computer and use it in GitHub Desktop.
Save mahdyar/e72758d4a7a850cb001e75b5b0c5f143 to your computer and use it in GitHub Desktop.
Detect which apps are running under Rosetta2 or native on Apple Silicon M1.
for appFolder in /Applications/*/ ; do
cd "$appFolder/Contents/MacOS/" 2> /dev/null
if [[ "$?" != 0 ]]; then continue; fi
for file in * ; do
if [ ! -d "$file" ] && [[ $file != *"."* ]]; then
architecture=$(file "$file")
if [[ $architecture != *"arm64"* ]]; then
echo "\"$file\" doesn't support arm64."
fi
fi
done
done
echo "\nMade with <3 by mahdyar.me"
@mahdyar
Copy link
Author

mahdyar commented Jan 30, 2021

It can be run simply with curl:

sh -c "$(curl -fsSL git.io/arm64)"

or:

sh -c "$(curl -fsSL https://gist.githubusercontent.com/mahdyar/e72758d4a7a850cb001e75b5b0c5f143/raw/86d4eb6662fcf8e9ffe82cd67d7c5fcf31e5943d/whichiswhich.sh)"

also, it can be downloaded and run manually:

chmod +x ./whichiswhich.sh
./whichiswhich.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment