My Demo App is a demo app built by Sauce Labs to showcase the mobile device cloud, Backtrace Error Reporting, Sauce Mobile Beta, and related products.
The feature/SauceMobileAppDistribution branch demonstrates the new crashless Sauce Mobile Beta Android artifact running beside Backtrace:
- Backtrace is the sole JVM and native crash owner.
- Sauce Mobile Beta keeps the TestFairy-compatible
com.testfairy.TestFairyAPI for sessions, feedback, screenshots, and remote logs. - Both products receive the same correlation, environment, release, build, and optional distribution attributes.
- Sauce Mobile Beta is a debug-only dependency and is absent from release builds by construction.
Debug builds depend on the published release com.saucelabs.mobilebeta:sauce-mobile-beta-android:2.2.0-rc from https://maven.testfairy.com by default.
Without credentials the SDK simply logs that it is not configured, so a fresh clone and CI build unchanged.
Disable the dependency entirely with -PsauceMobileBetaDisabled=true (or SAUCE_MOBILE_BETA_DISABLED=true).
Add the credentials to the existing gitignored local.properties file. Use local.properties.example as the template:
backtraceSubmissionUrl=https://submit.backtrace.io/<universe>/<token>/json
sauceMobileBetaToken=<sauce-mobile-beta-token>
sauceEnvironment=beta
sauceDistributionId=To pin a different published version or repository:
sauceMobileBetaVersion=2.2.0-rc
sauceMobileBetaRepository=https://maven.testfairy.comTo build against a locally built SDK instead (development only), point at the AAR (it takes precedence over the published version):
sauceMobileBetaAar=/absolute/path/to/testfairy-android-sdk/sauce-mobile-beta-android/build/outputs/aar/sauce-mobile-beta-android-release.aarlocal.properties is ignored by Git. Never place real credentials in app/build.gradle, committed Gradle property files, or source code.
./gradlew :app:assembleDebugBuild the SDK first:
cd ../testfairy-android-sdk
./gradlew :sauce-mobile-beta-android:assembleReleaseThen build this app. Values are loaded automatically from local.properties:
./gradlew :app:assembleDebugGradle -P properties and environment variables remain supported for CI. Their precedence is: command-line/project property, local.properties, environment variable, then safe default.
Supported environment variables include:
BACKTRACE_SUBMISSION_URL, SAUCE_MOBILE_BETA_TOKEN, SAUCE_MOBILE_BETA_AAR, SAUCE_MOBILE_BETA_VERSION, SAUCE_MOBILE_BETA_DISABLED, SAUCE_ENVIRONMENT, and SAUCE_DISTRIBUTION_ID.
The release workflow (.github/workflows/publish-on-release.yml) fills them from the repository secrets BACKTRACE_UNIVERSE, BACKTRACE_TOKEN (composed into https://submit.backtrace.io/<universe>/<token>/json) and SAUCE_MOBILE_BETA_TOKEN, so the published APKs report to Backtrace and Sauce Mobile Beta.
The Backtrace URL must be the JSON submission URL (…/json, or a URL containing format=json): the native crash integration derives its minidump endpoint from it and is only enabled for those forms; JVM reporting works with any form. With the database enabled, reports are queued under files/backtrace/ and resent until accepted.
The typed integration is in app/src/mobileBeta/java/com/saucelabs/mydemoapp/android/SauceMobileBetaIntegration.java.
When Backtrace is configured it registers the asynchronous session callback before initialization (mirroring the session URL into Backtrace attributes), disables auto-update for this demo, calls beginWithoutCrashHandler(...), and verifies that the default (Backtrace) JVM handler remains installed. Each SDK is configured independently: Sauce Mobile Beta still starts when Backtrace is not configured.
The release source set uses a no-op adapter and does not receive the Sauce Mobile Beta dependency.
This app is part of a set of demo apps.
This app has a QR code scanner. You can find it in the menu under the option "QR CODE SCANNER". This page opens the camera (you first need to allow the app to use the camera) which can be used to scan a QR Code. If the QR code holds an URL it will automatically open it in a browser. The following image can be used to demo this option.
To publish a new version, create a release with a valid semver tag name. A CI workflow will handle setting the app version name/code and upload the APK into the release.
