Build and Deployment
Building, bundling, and deploying Tauri apps for macOS
Build and Deployment
Building a Tauri app for production involves more steps and more gotchas than most frameworks. This section covers the full deployment pipeline, from cargo tauri build to installing the .app bundle on a target machine.
The Build Pipeline
Frontend Build -- Tauri runs
beforeBuildCommand(e.g.,vite build) to produce static assetsRust Compilation -- Cargo compiles the Rust backend in release mode
Asset Embedding --
tauri::generate_context!()embeds thefrontendDistcontents into the binaryBundle Creation -- Tauri packages everything into a
.appbundle (and optionally.dmg)
Topics in This Section
Building App Bundles -- The
cargo tauri buildcommand, bundle targets, icons, and installationmacOS Pitfalls -- Critical
.appreplacement issues that will waste hours of your timeCargo Cache Invalidation -- Forcing Cargo to re-embed frontend assets when it doesn't detect changes
Bundling Node.js -- Download script for including a standalone Node.js binary in your app
Quick Reference
# Build for production
cargo tauri build
# Build with a specific config
cargo tauri build --config tauri.conf.myapp.json
# The output .app bundle is at:
# target/release/bundle/macos/YourApp.app
# Install to /Applications
rm -rf /Applications/YourApp.app
cp -r target/release/bundle/macos/YourApp.app /Applications/Warning
Always rm -rf the old .app before copying the new one. See macOS Pitfalls for why cp -rf alone is not safe.