Android bug reports
With bug reporting enabled, your users and beta testers can report a bug from inside your Android app. A short form opens, they describe the issue and send it, and the report arrives in the Appelium Dashboard with a screenshot, a recording of the screen, the console logs and network logs that led up to it, and the device and app details. In-app bug reporting for Android and iOS walks through the flow from shake to fix, in beta testing and in production.
Enable bug reporting
AppeliumFeedback.start(
apiKey = "YOUR_API_KEY",
application = this,
bugReporting = BugReportingConfiguration.Enabled()
)
With the defaults, shaking the device opens the bug report form, and the report includes a screenshot and a screen recording with touch indicators. Each option can be changed:
AppeliumFeedback.start(
apiKey = "YOUR_API_KEY",
application = this,
bugReporting = BugReportingConfiguration.Enabled(
screenshotsEnabled = true,
screenRecording = BugReportingConfiguration.ScreenRecordingConfiguration.Enabled(renderTouchEvents = false),
invocationEvents = setOf(InvocationEvent.Shake, InvocationEvent.Screenshot)
)
)
| Option | Default | Description |
|---|---|---|
screenshotsEnabled |
true |
Attach a screenshot of the screen at the moment the form opens. |
screenRecording |
ScreenRecordingConfiguration.Enabled(renderTouchEvents = true) |
Attach a recording of up to the last 30 seconds of the app's screen. renderTouchEvents draws the user's touches as circles. Use ScreenRecordingConfiguration.Disabled to turn recording off. |
invocationEvents |
setOf(InvocationEvent.Shake) |
Which user actions open the form. See Invocation events. |
To add your own file to each report, pass a BugReportingDelegate as delegate.
Invocation events
InvocationEvent.Shake: the user shakes the device.InvocationEvent.Screenshot: the user takes a screenshot of the app, from Android 14. Add the permission listed in Permissions.emptySet(): no gesture opens the form. Use this when the report is opened only from your own UI.
Open the form from your app
Open the form from your own UI, for example from a "Report a problem" button in the settings screen:
import com.appelium.feedback.invoke
fun onReportProblemClicked() {
AppeliumFeedback.invoke(reporterEmail = currentUser?.email)
}
- Call it on the main thread, while one of your activities is shown.
reporterEmailprefills the email field. Passnull, or callinvoke()without it, to use the email the user entered in their previous report, if any.- The call does nothing if bug reporting is not enabled or the form is already open.
To send a report without showing the form at all, see Silent invocation.
Reporter email field
By default, the reporter must enter a valid email address before sending a report. Change it before the form is shown, for example right after start:
AppeliumFeedback.reporterEmailFieldMode = EmailFieldMode.OPTIONAL
| Mode | Behaviour |
|---|---|
EmailFieldMode.REQUIRED (default) |
The field is shown and a valid email address is needed to send. |
EmailFieldMode.OPTIONAL |
The field is shown and can be left empty. An entered address must be valid. |
EmailFieldMode.HIDDEN |
The field is not shown. A report carries only an email that you pass to invoke(reporterEmail). |
The form is prefilled with the email you pass to invoke(reporterEmail), or else with the one of the previous report. Surrounding spaces are ignored.
Screen names
Bug reports, crash reports and the activity log name the visible screen after its activity's class, for example CheckoutActivity. When one activity shows several screens, as with Jetpack Compose navigation, name each screen when it is shown:
import com.appelium.feedback.setScreenName
navController.addOnDestinationChangedListener { _, destination, _ ->
AppeliumFeedback.setScreenName(screenName = destination.route, activity = this)
}
- Call it on the main thread. The name is used as long as the activity exists; pass
nullto use its class name again. - When Android recreates the activity, for example after a configuration change, set the name again. The listener above does that, because it is called with the current destination when it is added.
- While the activity is shown, each new name is logged as the next screen.
- If you call
startafter an activity was shown, for example after the user's consent, that screen is logged when it is shown again or gets a new name.
What the reporter sees
The form contains:
- an email field, depending on the reporter email field mode;
- a description field;
- the screenshot, which the reporter can open and mark up to highlight the problem;
- the screen recording.
The reporter can remove the screenshot or the recording before sending.
What a bug report contains
- The reporter's description and, if collected, email address.
- The screenshot and screen recording, if enabled and not removed by the reporter.
- The activity log from before the report: console logs, network logs and app events. See logs retention.
- The name of the screen that was visible. See Screen names.
- Device and app details such as the device model, Android version, app version and build, and locale.
- The user identifier and backend environment, if set.
- Your attachment, if a delegate is configured.
Privacy
The screenshot and the screen recording show everything that was on the app's screen, including any text the user typed and the content of SurfaceViews, such as maps, video, camera previews and Flutter screens. The content of secure surfaces (SurfaceView.setSecure) is not captured. It stays on the device and is uploaded only when the reporter sends a report. If your app shows sensitive content, consider disabling it with ScreenRecordingConfiguration.Disabled, or offering bug reporting only to beta testers or internal builds.
Troubleshooting
- Shaking does nothing: check that
bugReportingis enabled andinvocationEventscontainsInvocationEvent.Shake. In the emulator, use Extended controls › Virtual sensors › Move. - The form never opens from
invoke: check that bug reporting is enabled instart, thatinvokeis called afterstart, and that one of your activities is in the foreground. - The Send button stays disabled: the email field is required and the address is not valid. Use
EmailFieldMode.OPTIONALorEmailFieldMode.HIDDENif your users should not need one.