Building Applications

Build and package your Wails application

Wails v3 uses Task as its build system. The wails3 build and wails3 package commands are convenient wrappers around Task.

Building

Build for the current platform:

bash
wails3 build

Build for a specific platform:

bash
wails3 build GOOS=windows
wails3 build GOOS=darwin
wails3 build GOOS=linux

# With architecture
wails3 build GOOS=darwin GOARCH=arm64

# Environment variable style works too
GOOS=windows wails3 build

Output goes to the bin/ directory.

Development

Run your application with hot reload:

bash
wails3 dev

This starts a file watcher that rebuilds and restarts your app on changes. The frontend dev server runs on port 9245 by default.

bash
# Custom port
wails3 dev -port 3000

# Enable HTTPS
wails3 dev -s

Packaging

Package your app for distribution:

bash
wails3 package
wails3 package GOOS=windows
wails3 package GOOS=darwin
wails3 package GOOS=linux

This creates platform-specific packages:

Custom Build Tags

Pass custom Go build tags with the -tags flag:

bash
# Build with legacy GTK3 + WebKit2GTK 4.1 on Linux (default is GTK4 + WebKitGTK 6.0)
wails3 build -tags gtk3

# Build in server mode (no GUI, CGO-free)
wails3 build -tags server

# Combine multiple tags
wails3 build -tags gtk3,customtag

Tags are forwarded as EXTRA_TAGS to the underlying Taskfile. See Server Build and Linux Packaging - Legacy GTK3 Support for details.

Using Task Directly

For more control, use Task directly:

bash
# List available tasks
wails3 task --list

# Verbose output
wails3 task build -v

# Dry run
wails3 task --dry

# Force rebuild
wails3 task build -f

# Pass variables
wails3 task darwin:build ARCH=amd64

Platform-specific tasks like linux:create:deb or darwin:build:universal are only available through Task.

Generating Assets

Regenerate icons or update build configuration:

bash
wails3 generate icons -input build/appicon.png
wails3 update build-assets -name "MyApp" -config build/config.yml -dir build
Edit page

Last updated: