Upload dSYMs and report builds to BugSnag using Fastlane.
Use our Fastlane plugin to:
This documentation is for the v2 BugSnag Fastlane plugin. Please use fastlane update_plugins to update to the latest plugin.
To install the BugSnag plugin run:
$ fastlane add_plugin bugsnag
The BugSnag Fastlane plugin has two actions:
upload_symbols_to_bugsnag (iOS only)send_build_to_bugsnag (iOS and Android)Add these actions to a lane in your Fastfile to use them. The plugin will automatically detect some parameters for you, or will provide a default. The order of precedence for each parameter is:
Fastfileupload_symbols_to_bugsnag only)By default, the BugSnag Fastlane plugin will read your API key, and release stage from your application’s Info.plist file.
You should ensure that you have a dict-type key named bugsnag which contains two sub string-typed keys which are your BugSnag API key, and release stage.
<key>bugsnag</key>
<dict>
<key>apiKey</key>
<string>YOUR_API_KEY_HERE</string>
<key>releaseStage</key>
<string>YOUR_RELEASE_STAGE_HERE</string>
</dict>
Older versions of bugsnag-cocoa (v5 and older) will use an Info.plist that has the following structure. We’ll use this as a fallback if a new format Info.plist is not found:
<key>BugsnagAPIKey</key>
<string>YOUR_API_KEY_HERE</string>
You can find your API key when creating a project in your BugSnag dashboard, or later from your project settings page.
By default, the BugSnag Fastlane plugin will read your API key from the metadata of your application’s AndroidManifest.xml:
<application>
<meta-data android:name="com.bugsnag.android.API_KEY"
android:value="YOUR-API-KEY-HERE"/>
</application>
You can find your API key when creating a project in your BugSnag dashboard, or later from your project settings page.
To get a verbose output from the Fastlane BugSnag plugin actions, append the --verbose flag to your fastlane command, e.g.:
$ fastlane ios release --verbose
BugSnag can replace the raw memory addresses which appear in iOS stacktraces with human-readable function names, file paths, and line numbers. This process, known as symbolication, requires the contents of your debug symbol (dSYM) files, which are generated when compiling your app.
Add the upload_symbols_to_bugsnag action to any lane in your Fastfile that you use when releasing your app, for example :beta and :release:
lane :release do
# ...
upload_symbols_to_bugsnag(
config_file: "/example/path/to/config/Info.plist"
# other options ...
)
end
The action automatically detects:
Info.plistbugsnag.apiKey in Info.plistTo see all options and default values, call:
$ fastlane action upload_symbols_to_bugsnag
Setting any of these options will override automatically detected parameters.
| Option | Description | Environment Variable |
|---|---|---|
config_file |
The path to the project’s Info.plist. Set this value if your configuration file is not automatically detected | BUGSNAG_CONFIG_FILE |
api_key |
BugSnag API key of the project the dSYMs are applied to | BUGSNAG_API_KEY |
dsym_path |
Path to the DSYM directory, file, or zip to upload | BUGSNAG_DSYM_PATH |
upload_url |
If you are using On-premise then set this to the upload endpoint of your server, or if you are on the BugSnag for Enterprise instance then use https://upload.bugsnag.smartbear.com/. Defaults to https://upload.bugsnag.com/. |
BUGSNAG_UPLOAD_URL |
symbol_maps_path |
Path to the BCSymbolMaps directory to build complete dSYM files | BUGSNAG_SYMBOL_MAPS_PATH |
project_root |
Root path of the project | BUGSNAG_PROJECT_ROOT |
ignore_missing_dwarf |
Throw warnings instead of errors when a dSYM with missing DWARF data is found. Defaults to false. |
BUGSNAG_IGNORE_MISSING_DWARF |
ignore_empty_dsym |
Throw warnings instead of errors when a *.dSYM file is found rather than the expected *.dSYM directory. Defaults to false. |
BUGSNAG_IGNORE_EMPTY_DSYM |
Add the send_build_to_bugsnag action to any lane in your Fastfile that you use when releasing your app, for example :beta and :release:
lane :release do
# ...
send_build_to_bugsnag(
config_file: "/example/path/to/config/Info.plist"
# other options ...
)
end
The action automatically detects:
whoami commandIn addition, on iOS, the action automatically detects:
bugsnag.apiKey in Info.plistbugsnag.releaseStage in Info.plistCFBundleVersion and CFBundleShortVersionString in Info.plist respectivelyAnd on Android, the action automatically detects:
meta-data value of com.bugsnag.android.API_KEY in AndroidManifest.xmlversionName and versionCode in the module-level build.gradle fileTo see all options and default values, call:
$ fastlane action send_build_to_bugsnag
Setting any of these options will override automatically detected parameters.
| Option | Description |
|---|---|
config_file |
The path to the project’s Info.plist or AndroidManifest.xml. Set this value if your configuration file is not automatically detected |
api_key |
The BugSnag API key used to send requests |
app_version |
The version of the application |
android_version_code |
The version code of the Android application |
ios_bundle_version |
The bundle version of the iOS application |
release_stage |
The current stage of build being deployed, such as “production” or “beta” or “staging” |
builder |
The entity building and releasing the application, such as the name of the current user |
repository |
The source control repository being deployed |
revision |
The source control revision being deployed |
provider |
The name of the source control provider, from: github, github-enterprise, gitlab, gitlab-onpremise, bitbucket, or bitbucket-server |
endpoint |
If you are using On-premise then set this to the build endpoint of your server, or if you are on the BugSnag for Enterprise instance then use https://build.bugsnag.smartbear.com/. Defaults to https://build.bugsnag.com/. |
metadata |
Key value pairs containing custom build information. The keys and values must be strings. Nested objects aren’t supported. |