Skip to content

Instantly share code, notes, and snippets.



Last active Dec 30, 2020
What would you like to do?
Determine if a Mac can run ARM64 code, whether or not the binary is running in Rosetta 2 via pyobjc
from Foundation import NSBundle
import objc
CF = NSBundle.bundleWithPath_('/System/Library/Frameworks/CoreFoundation.framework')
f = [('CFBundleIsArchitectureLoadable', 'BQ')]
objc.loadBundleFunctions(CF, globals(), f)
NSBundleExecutableArchitectureARM64 = 0x0100000c
def is_arm64():
return CFBundleIsArchitectureLoadable(NSBundleExecutableArchitectureARM64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment