BugSnag is now Insight Hub – we're making some changes to how the product looks, but this won't impact the way you use BugSnag or any of your integrations.

Upload React Native symbols

Your React Native app can send stacktraces to BugSnag in both JavaScript format as well that of the native Android or Apple device. If the code in your app is obfuscated or minified then you will need to upload various files to BugSnag so that a full stacktrace with methods, file paths and line numbers can be shown.

The file types to consider for upload are:

  • JavaScript bundles and source maps – for both Android and Apple builds
  • Android ProGuard mappings
  • Android NDK symbol (.so) files
  • Apple symbol (.dSYM) files

For installation instructions for the BugSnag CLI, please see our Installation guide.

Overview

The react-native command attempts to upload the bundled JavaScript source maps and native symbol/mapping files generated during a release build and uploads it to the appropriate BugSnag upload APIs.

This command is a convenience wrapper for the following commands, which upload the different file types separately with more specific options available to customize the upload:

Example usage

The simplest way to run the command is from the root directory of your React Native project:

$ bugsnag-cli upload react-native

Available options

Android app manifest (--android-app-manifest)

The path to a manifest file (AndroidManifest.xml) from which to obtain build information.

Android variant (--android-variant)

The build type/flavor (e.g. debug, release) used to disambiguate the between built files when searching the project directory.

Android version code (--android-version-code)

The version code of this build of the application.

API key (--api-key)

The BugSnag API key for the application.

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

Bundle (--bundle)

The path to the bundled JavaScript file to upload.

Code bundle id (--code-bundle-id)

A unique identifier for the JavaScript bundle.

If you use CodePush, or similar mechanism, to update the JavaScript bundle of your app without changing the native version or build number, use the code bundle ID to uniquely identify the update. This same ID must also be set in the BugSnag configuration in your app, so that errors match the uploaded bundle.

Dev (--dev)

Indicates whether this is a debug or release build.

Dry run (--dry-run)

Performs a dry-run of the command without sending any information to BugSnag.

Fail on upload error (--fail-on-upload-error)

Stops the upload when a file fails to upload successfully.

IOS bundle version (--ios-bundle-version)

The bundle version of this build of the application (Apple platforms only).

IOS plist (--ios-plist)

The path to a .plist file from which to obtain build information.

IOS scheme (--ios-scheme)

The name of the Xcode options.Ios.Scheme used to build the application.

IOS xcarchive path (--ios-xcarchive-path)

The path to the Xcode archive to process if it has been exported.

IOS xcode project (--ios-xcode-project)

The path to an Xcode project, workspace or containing directory from which to obtain build information.

Log level (--log-level)

Sets the level of logging to debug, info, warn or fatal.

Default: info.

Overwrite (--overwrite)

Whether to ignore and overwrite existing uploads with same identifier, rather than failing if a matching file exists.

Port (--port)

The port number for the BugSnag upload server.

Default: 443.

Project root (--project-root)

The path to strip from the beginning of source file names referenced in stacktraces on the BugSnag dashboard.

Default: the root directory if the command has detected one, otherwise it’s empty.

Retries (--retries)

The number of retry attempts before failing an upload request.

Default: 0.

Source map (--source-map)

The path to the source map file to upload.

Timeout (--timeout)

The number of seconds to wait before failing an upload request.

Default: 300.

Upload API root URL (--upload-api-root-url)

The upload server hostname, optionally containing port number.

For use in BugSnag On-premise configurations. The command will append the appropriate path to access the correct upload endpoint.

Default: https://upload.bugsnag.com.

Verbose (--verbose)

Sets the level of the logging to its highest.

This is the equivalent of setting the log level to debug.

Version name (--version-name)

The version of the application.