Skip to content
Docs GitHub

build

Manage mobile build artifacts

Upload builds to a project

Arguments:

ArgumentDescription
<path...>Path(s) to the build(s) to upload (APK or AAB)

Options:

OptionDescription
--build-configuration <build-configuration>Build configuration for the upload (defaults to the current version)
--release-notes <release-notes>Release notes for the build
--install-group <install-group>...Install group(s) for this build (repeatable); builds sharing a group show updates for each other
--head-sha <head-sha>VCS commit SHA (defaults to the current commit)
--base-sha <base-sha>VCS base commit SHA (defaults to the merge-base with the base ref)
--vcs-provider <vcs-provider>VCS provider (defaults to the current remote's provider)
--head-repo-name <head-repo-name>Head repository name, e.g. owner/repo (defaults to the current)
--base-repo-name <base-repo-name>Base repository name, e.g. owner/repo (for forks)
--head-ref <head-ref>Head branch/reference (defaults to the current branch)
--base-ref <base-ref>Base branch/reference (defaults to the merge-base tracking ref)
--pr-number <pr-number>Pull request number (auto-detected in pull_request GitHub Actions runs)
--force-git-metadataForce collecting git metadata even outside CI (conflicts with --no-git-metadata)
--no-git-metadataDisable automatic git metadata collection

Download a build artifact

Arguments:

ArgumentDescription
<build-id>ID of the build to download

Options:

OptionDescription
-o, --output <output>Output path (default: preprod_artifact_. in the current directory)

All commands support --json for machine-readable output and --fields to select specific JSON fields.

Terminal window
# Upload an Android build (APK or AAB) for size analysis
sentry build upload ./app-release.apk
# Upload with a build configuration and release notes
sentry build upload ./app.aab --build-configuration Release --release-notes "Nightly"
# Tag a build with install groups (repeatable)
sentry build upload ./app.aab --install-group qa --install-group beta
# Attach explicit git metadata (otherwise auto-collected in CI)
sentry build upload ./app.aab --head-sha "$GIT_SHA" --pr-number 42 --base-ref main
# Download a build artifact by ID
sentry build download 1234567890
# Download to a specific path
sentry build download 1234567890 --output ./app.ipa
# Output the result as JSON
sentry build download 1234567890 --json
  • build upload supports Android APK and AAB. iOS XCArchive/IPA upload is not yet supported. Sentry SaaS only.
  • Multiple paths may be uploaded at once; the command exits non-zero if any build fails to upload.
  • Git metadata (commit, branch, PR number, repo) is auto-collected in CI (GitHub Actions env vars + the local git repo). Use --no-git-metadata to disable it, --force-git-metadata to collect outside CI, or the explicit --head-sha / --base-sha / --head-ref / --base-ref / --pr-number / --vcs-provider / --head-repo-name / --base-repo-name flags to override.
  • build download fetches a mobile build artifact (APK or IPA) previously uploaded to Sentry's preprod system for size analysis. Sentry SaaS only.
  • The build must be installable. Builds that are still processing — or that have no downloadable artifact — cannot be downloaded.
  • Without --output, the artifact is saved as preprod_artifact_<build-id>.<ext> in the current directory.
  • The organization is resolved from --org, SENTRY_ORG, config defaults, or a detected DSN.