Building a Universal Binary with Tauri v2 — It's Easier Than You Think
Source: Dev.to
All tests run on an 8‑year‑old MacBook Air. Intel Mac users still exist, but Apple Silicon is the future. A universal binary covers both with a single DMG.
Why bother with a universal binary?
Because “this app requires Rosetta” is a friction point at install time. Some users don’t have Rosetta installed, some corporate machines block it, and many users simply don’t know what it is.
A universal binary runs natively on both architectures—no Rosetta, no support tickets.
The Tauri build command
npm run tauri build -- --target universal-apple-darwin
Build time is roughly double since you’re compiling for two targets. On an 8‑year‑old MacBook Air, plan for it.
The gotchas
-
External binaries – If your Tauri app bundles external binaries (e.g., ADB, ffmpeg, anything), each one must be a universal binary or you need architecture‑specific versions with runtime selection.
-
Bundled ADB example
// placeholder for ADB‑related Rust code -
Architecture‑specific crashes – The most common universal‑binary bug: it builds and runs fine on your machine but crashes on the other architecture because of an assumption baked into the code. If you only have one machine, use GitHub Actions with both runners.
-
DMG size – Roughly doubles the binary size. For most Tauri apps this is still small (≈ 10‑20 MB instead of 5‑10 MB). Not a real concern.
The verdict
Do it before your first release. Retrofitting a universal binary after users are already on Intel‑only builds creates a confusing update path.
If this was useful, a ❤️ helps more than you’d think — thanks!
Hiyoko PDF Vault
@hiyoyok