Gather the architecture of running processes on macOS 11+
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boB Rudis 67d2eef167
4 weeks ago
.gitignore .gitignore 4 weeks ago
LICENSE license 1 month ago
Makefile single pid + leak checks 4 weeks ago single pid + leak checks 4 weeks ago README 4 weeks ago
archinfo.c single pid + leak checks 4 weeks ago


Returns a list of running processes and the architecture they are running under.

Apple M1/Apple Silicon/arm64 macOS can run x86_64 programs via Rosetta and most M1 systems currently (~March 2021) very likely run a mix of x86_64 and arm64 processes.

Activity Monitor can show the architecture, but command line tools such as ps and top do not due to Apple hiding the details of the proper sysctl() incantations necessary to get this info.

Patrick Wardle reverse-engineered Activity Monitor — — and I slapped that hack into a bare-bones command line utility archinfo.

It returns columnar output or JSON (via --json) — that will work nicely with jq — of running processes and their respective architectures.

Build from source or grab from the releases.

$ archinfo
   5949  arm64 /System/Library/Frameworks/AudioToolbox.framework/AudioComponentRegistrar
   5923  arm64 /System/Library/CoreServices/
   5901 x86_64 /Library/Application Support/Adobe/Adobe Desktop Common/IPCBox/
   5873  arm64 /Applications/Utilities/Adobe Creative Cloud Experience/CCXProcess/
   5863  arm64 /bin/sleep
   5861 x86_64 /Applications/
   5855 x86_64 /Applications/Elgato Control Control Center
   5852 x86_64 /Applications/
   5849  arm64 /System/Library/CoreServices/
$ archinfo --pid $(pgrep keyboardservicesd)
  60298 x86_64 /usr/libexec/keyboardservicesd

$ archinfo --json --pid $(pgrep keyboardservicesd)
Rscript -e 'table(jsonlite::stream_in(textConnection(system("/usr/local/bin/archinfo --json", intern=TRUE)))$arch)'
## arm64 x86_64
##   419     29