How to determine if a MacOS program on Apple Silicon is emulated x86 or native ARM from the command line?
-
30-05-2021 - |
Question
I have an M1 MacBook Pro and have downloaded both some native (ARM) and x86_64(Rosetta 2 emulated) binaries.
- How do I determine from the command line which of these ISAs a particular binary file is?
- Is there any way to know if a currently running program is running native or under Rosetta 2?
Solution
Run file on a binary:
krismatth@KristophersMBP3 ~$ file /bin/bash
/bin/bash: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/bin/bash (for architecture x86_64): Mach-O 64-bit executable x86_64
/bin/bash (for architecture arm64e): Mach-O 64-bit executable arm64e
Activity Monitor shows the architecture of running programs:
Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange