How to determine if a MacOS program on Apple Silicon is emulated x86 or native ARM from the command line?

apple.stackexchange https://apple.stackexchange.com/questions/407467

  •  30-05-2021
  •  | 
  •  

Domanda

I have an M1 MacBook Pro and have downloaded both some native (ARM) and x86_64(Rosetta 2 emulated) binaries.

  1. How do I determine from the command line which of these ISAs a particular binary file is?
  2. Is there any way to know if a currently running program is running native or under Rosetta 2?
È stato utile?

Soluzione

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:

enter image description here

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a apple.stackexchange
scroll top