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:
.so
) files.dSYM
) filesFor installation instructions for the BugSnag CLI, please see our Installation guide.
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:
The simplest way to run the command is from the root directory of your React Native project:
$ bugsnag-cli upload react-native
--android-app-manifest
)The path to a manifest file (AndroidManifest.xml) from which to obtain build information.
--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
)The version code of this build of the application.
--api-key
)The BugSnag API key for the application.
You can find your API key in Project Settings from your BugSnag dashboard.
--bundle
)The path to the bundled JavaScript file to upload.
--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
)Indicates whether this is a debug or release build.
--dry-run
)Performs a dry-run of the command without sending any information to BugSnag.
--fail-on-upload-error
)Stops the upload when a file fails to upload successfully.
--ios-bundle-version
)The bundle version of this build of the application (Apple platforms only).
--ios-plist
)The path to a .plist file from which to obtain build information.
--ios-scheme
)The name of the Xcode options.Ios.Scheme used to build the application.
--ios-xcarchive-path
)The path to the Xcode archive to process if it has been exported.
--ios-xcode-project
)The path to an Xcode project, workspace or containing directory from which to obtain build information.
--log-level
)Sets the level of logging to debug, info, warn or fatal.
Default: info
.
--overwrite
)Whether to ignore and overwrite existing uploads with same identifier, rather than failing if a matching file exists.
--port
)The port number for the BugSnag upload server.
Default: 443
.
--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
)The number of retry attempts before failing an upload request.
Default: 0
.
--source-map
)The path to the source map file to upload.
--timeout
)The number of seconds to wait before failing an upload request.
Default: 300
.
--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
)Sets the level of the logging to its highest.
This is the equivalent of setting the log level to debug
.
--version-name
)The version of the application.