0Pricing
Learn Rust Coding · Lesson

Packaging a Desktop App

Ship a runnable binary.

From Debug to Release

Development uses cargo run, which builds an unoptimized debug binary. For distribution you want a release build: cargo build --release.

Release builds enable optimizations and strip debug overhead, producing a far smaller, faster binary under target/release/.

cargo build --release
# binary at target/release/my_app

Shrinking the Binary

egui apps can be large because they statically link a GPU backend. Trim size with a release profile in Cargo.toml.

Enabling link-time optimization, a single codegen unit, panic-abort, and stripping symbols can cut megabytes off the final executable.

[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true

All lessons in this course

  1. Immediate-Mode UI Basics
  2. Widgets and Layout
  3. Managing App State
  4. Packaging a Desktop App
← Back to Learn Rust Coding