BugSnag CLI (Dart / Flutter)

Upload your Flutter app's Dart symbol files to BugSnag using our CLI.

If you are stripping debug symbols from your Dart code when building your Flutter apps, you will need to upload symbol files in order to see full stacktraces in BugSnag. The BugSnag CLI will do this with a single command, as described below.

We recommend you integrate the CLI into your build tools to fully automate the process.

Installation

The source code and binaries for our CLI are available on our GitHub repository for macOS, Linux and Windows.

To install or upgrade to the latest binary for your architecture, you can also run the following cURL or Wget commands:

curl -o- https://raw.githubusercontent.com/bugsnag/bugsnag-cli/main/install.sh | bash
wget -qO- https://raw.githubusercontent.com/bugsnag/bugsnag-cli/main/install.sh | bash

The script downloads the appropriate binary and attempts to install it to /usr/local/bin.

Usage

To upload symbol files, specify your BugSnag API key and the directory of the generated symbol files:

$ bugsnag-cli upload dart --api-key=YOUR_API_KEY app-debug-info/

You can find your API key in Project Settings from your Bugsnag dashboard.

See the Showing full stacktraces guide for details of how to generate symbols in a Flutter app.

For iOS, the app’s binary is also required in order to obtain a unique build identifier. The above command will find the binary if your project uses the standard directory structure for a Flutter project. Use the --ios-app-path option to override the path for non-standard project structures.

Option reference

Property Type Description
--api-key string your project’s API key [required]
--app-bundle-version string the iOS bundle version of this build of the app – used for display purposes for your build in the BugSnag dashboard
--app-version string the version of this build of the app – used for display purposes for your build in the BugSnag dashboard
--app-version-code string the Android version code of this build of the app – used for display purposes for your build in the BugSnag dashboard
--fail-on-upload switch whether to exit immediately if a file fails to upload
--ios-app-path string the path to the iOS app binary
--overwrite switch whether to ignore and overwrite existing uploads with same version
--retries number the number of retry attempts before failing an upload (default: 0)
--timeout number the number of seconds to wait before failing an upload attempt (default: 300)
--upload-api-root-url string the BugSnag On-premise upload server URL, optionally containing port number