Script Snippet to Determine if You Are on an ARM Mac or Not

Today I figured out a way to determine if the Mac you are on is an ARM Mac or not.

Usually, you'd use the arch command, but that may not return accurate information if your terminal app is running under Rosetta (for example, that's the recommended way to install/run brew at the moment).

However, when downloading apps that have a separate ARM or Intel version, it is important to get the proper version. For example, I want the ARM version of Zoom.

#!/bin/zsh -f

ARCH=$(sysctl kern.version | awk -F'_' '/RELEASE/{print $2}')

if [[ "$ARCH" == "ARM64" ]]
elif [[ "$ARCH" == "X86" ]]
	echo "Unknown arch returned: '$ARCH'" >>/dev/stderr 
	exit 2

echo "$ARCH"
exit 0

You could also use this for Keyboard Maestro in an “IF” statement, for example.

This is also available as a gist.

(Crossposted to MacPowerUsers forum.)


Great way to find out but I added to next to last line to put the output in the clipboard.

echo "$ARCH" | pbcopy


1 Like

You can also tell Keyboard Maestro to put the results of a shell script onto the clipboard if you want.