During the transition from Intel (x86_64) to Apple Silicon (arm64) processors, macOS developers rely heavily on “Universal Binaries.” A Universal Binary is a single application file that actually contains two completely separate executable files inside it: one compiled for Intel chips, and one compiled for Apple Silicon. When the user launches the app, macOS automatically detects their CPU and runs the correct version. To inspect, create, or modify these multi-architecture files directly from the terminal, developers use the macOS lipo command.
Why Use the lipo Command?
The lipo utility is an essential tool for macOS software distribution. It allows developers to fuse an Intel binary and an ARM binary together into a single distributable file. Furthermore, if you are a user trying to save disk space, you can use lipo to manually “thin” an application—extracting only the architecture your Mac needs and discarding the other, potentially saving hundreds of megabytes per application.
Step 1: Check the Architectures of a Binary
Before modifying a file, you should check which architectures it contains.
- Open the macOS Terminal app.
- Use the
-infoflag followed by the path to the executable file (not the .app bundle, but the actual binary inside the bundle):
lipo -info /Applications/Example.app/Contents/MacOS/Example
The terminal will output something like: Architectures in the fat file: ... are: x86_64 arm64. (macOS historically refers to multi-architecture files as “fat” files).
Step 2: Create a Universal Binary
If you have compiled two separate versions of your software, you can combine them.
- Use the
-createflag, specify the output file using-output, and then list the input files:
lipo -create app_intel app_arm64 -output app_universal
This merges app_intel and app_arm64 into a single executable named app_universal that will run natively on any modern Mac.
Step 3: Thin a Binary (Remove Unused Architectures)
If you only have an Apple Silicon Mac, you do not need the Intel (x86_64) code taking up space.
- Use the
-thinflag to extract only a specific architecture, and-outputto save it:
lipo /Applications/Example.app/Contents/MacOS/Example -thin arm64 -output /Desktop/Example_Thinned
You can then replace the original “fat” binary inside the app bundle with your new, lightweight “thinned” binary. Warning: Modifying binaries inside a signed app bundle will break its cryptographic signature, requiring you to re-sign the app using the codesign utility before macOS will allow it to launch.
By mastering the lipo command, macOS developers and power users gain precise control over how executable files are structured and deployed across different hardware generations.