Skip to content

Packaging and installing

Run bellui package in the folder of your app’s main package. It builds the app and wraps it in the target platform’s format:

bellui package -os darwin

-os (also spelled --target) chooses the platform. Without it, the command packages for the system it runs on. The app name comes from --name, then the manifest’s name, then the last element of your module path.

-osOutput
darwinName.app, a macOS application bundle.
windowsName.exe with the icon, version information and an application manifest built in.
linux, freebsd, openbsd, netbsdName.tar.xz (.tar.gz on OpenBSD) holding the binary, a desktop entry, the icon and a Makefile.
android, android/arm64, android/arm, android/amd64, android/386Name.apk. Plain android includes all four architectures.
ios, iossimulatorName.app, for a device or for the iOS Simulator.
web (or wasm)A wasm folder holding everything needed to serve the app.

Useful flags:

  • --app-id, --name, --app-version, --app-build and --icon override the manifest.
  • --release builds an optimised, non-debuggable package. It is still signed with a development key on Android, so you can install it directly. For a store submission use bellui release.
  • --tags passes Go build tags, for example --tags gl for the OpenGL renderer.
  • --exe wraps an executable you built yourself instead of building one (desktop and web only).
  • --src packages a different folder than the current one (not for mobile).
  • --android-min-sdk sets the oldest Android API level the app installs on. The default is 23 (Android 6), and the lowest allowed is 21.
Desktop packages are built with cgo, which needs a C compiler for the target system. The simplest way is to package each desktop platform on that platform.

Shared libraries the app loads

Some Go modules link C libraries as shared libraries instead of into the executable. The FFmpeg builds that x/mmedia uses are one: an app built with them does not start without them. bellui package finds the libraries the executable loads from the goffmpeg-libs modules and puts them in the package:

PlatformWhere they go
macOSContents/Frameworks in the .app
Linux and BSDlib/<app id>/ in the archive, which its Makefile installs
Windowsbeside the .exe
Androideach architecture’s lib/<abi>/ in the APK
iOSFrameworks/ in the .app, signed with the app

The executable is pointed at the copies, so it no longer looks in your Go module cache. bellui release signs the macOS libraries with the app’s certificate and puts the Windows DLLs in the MSIX. A build with --tags goffmpeg_novideo carries only the audio libraries. On Android and iOS, a library of the same name in android/libs or ios/Frameworks is an error.

Platform notes

The bundle holds the executable in Contents/MacOS, an icon.icns made from your icon, and an Info.plist with the app ID, name, version and build number. File associations, URL schemes and usage descriptions from the manifest are written into Info.plist too.

Without an app ID the bundle gets com.example.<name>.

Installing on this computer

bellui install packages the app and installs it in the usual place:

SystemInstalled to
macOS/Applications
WindowsProgram Files\<name>, after an administrator prompt
Linux and BSD/usr/local (or /usr if there is no /usr/local)

--dst chooses another folder. On Linux, installing to the system folders needs root.

bellui install can also fetch an app from its Git repository, build it in release mode and install it:

bellui install github.com/example/notes@latest

@<branch-or-tag> installs that branch or tag, and with no @ the default branch is used. @latest takes the last tag starting with v in the repository’s tag list.

Installing on a phone or simulator

With -os, bellui install packages for a mobile target and installs there:

-osUses
android and the android/… variantsadb install to the connected device or emulator
iosios-deploy to the connected device
iossimulatorxcrun simctl install to the booted simulator, then starts the app

The tools in the right-hand column must be installed and on your PATH.

Building without packaging

bellui build builds only the executable, with the same -os, --tags, --release and -o flags. --pprof adds Go’s profiling server, on port 6060 unless you set --pprof-port.