AppInspect
On this page
Configuration

Configuration reference

The defaults assume a developer holding the phone: everything visible, everything editable. That is the right default for a debug build and the wrong one for a build you hand to twenty external testers. This page is the single list of what you can change and what each switch actually does.

Where the configuration goes

With no configuration at all, AppInspect initialises itself through AndroidX Startup and uses the defaults. To change anything, call install() from your Application instead:

DebugApplication.kt (debug source set)
AppInspect.install(
    application = this,
    configuration = AppInspectConfiguration(
        enablement = AppInspectEnablement(/* … */),
        entryPoints = AppInspectEntryPoints(/* … */),
        panels = AppInspectPanels(/* … */),
        powerTools = AppInspectPowerTools(/* … */),
    ),
)

Keep the call in a debug-only source set: it does not exist in appinspect-no-op. See install. AppInspect.initialize(configuration) is the older entry point and still works, but prefer install().

AppInspectConfiguration is a group of small objects rather than one flat list of flags: enablement, entryPoints, panels, powerTools, retention, environment, initialMetadata, redaction and branding. Each group below covers one of them.

Enablement — whether it runs at all

This is the outermost gate, and it is checked independently of which artifact you depended on. It is why the runtime self-disable described in the security model works.

allowedBuildTiersdefault: DEBUG only
Which build tiers may run the inspector. A LinkedHashSet of AppInspectBuildTier values, so linkedSetOf(AppInspectBuildTier.DEBUG) is the default shape.
allowInNonDebugBuildsdefault: false
Required before the library will run in a build where FLAG_DEBUGGABLE is not set — a release-signed staging build, for example.
allowInProductionBuildsdefault: false
A second, separate opt-in for production. Both this and allowInNonDebugBuilds have to be shipped as true in the APK before the inspector can run for real users. There is no way to flip either at runtime.
If you enable a non-debuggable build

Turn response mocking off in the same commit (allowResponseMocking = false). A shared staging build that can rewrite live traffic is a support incident waiting to happen.

Entry points — how it opens

Each of these can be switched off independently, which is how you hand over a build without advertising that the inspector exists. Opening the inspector covers the behaviour of each one.

shakeToOpenEnableddefault: true
Open on a deliberate shake.
shakeThresholdGravitydefault: 2.7f
Total accelerometer magnitude, gravity included, that counts as a shake. Lower for a lighter shake; values below about 1.5 g are floored.
shakeCooldownMillisdefault: 1500
How long shakes are ignored after one is accepted.
launcherShortcutEnableddefault: true
Register a dynamic launcher shortcut that opens the inspector from the home screen.
autoOpenOnLongPressTriggerdefault: true
Whether an accepted long-press trigger opens the inspector immediately, or only reports the gesture so you can confirm it yourself.
networkNotificationsEnableddefault: true
Post a notification per captured call. Worth turning off when lock-screen visibility is a concern, or when the build goes to testers who would find it noisy. See Network notifications.
openInSeparateTaskdefault: true
Open the inspector in its own task, so it gets a separate Recents card and can be used in split-screen next to your app. Set to false to open it stacked in the current task.

Panels — what appears

All default to true. Hiding a panel removes it from the UI; it does not by itself remove the underlying capability, which is what the power tools below are for.

networkEnabled
The Network tab.
mocksEnabled
The Mocks tab. Visibility only — whether a rule can actually replace a response is allowResponseMocking. A build can therefore show the panel but be unable to mock, or hide the panel while a committed mocks.json keeps working.
storageEnabled
The Storage tab.
workManagerEnabled
The Work tab.
crashesEnabled
The Crashes tab. Turn it off for an audience that should not be reading stack traces.
runtimeEnabled
The Runtime button in the top bar — Runtime is not a bottom-bar tab.

Power tools — what can be seen and changed

These are the switches that matter when the build leaves your desk. All default to true, because the default audience is a developer debugging their own app.

showRawSensitiveValuesdefault: true
When false, configured headers, query parameters, body fields, cookies and metadata keys are masked or removed before they are stored — not merely hidden in the UI. Which keys count as sensitive comes from the redaction group.
allowSharedPreferencesEditingdefault: true
Write access to SharedPreferences. Off means the panel is a reader.
allowDatabaseEditingdefault: true
Structured row editing in host databases.
allowSqlConsoledefault: true
The free-form SQL console.
allowResponseMockingdefault: true
The master capability for response mocking. When false, no rule can replace a response no matter what mocks.json or the in-app switch says, and the adb-pullable mirror file is never written.

Retention — how much is kept

Captured events live in AppInspect's own app-private database with a cap; the oldest are dropped once it is reached. The defaults are 300 network events and 50 crashes. Raise them if you are chasing something intermittent over a long session, lower them if you would rather keep less of it around.

Environment and metadata

environment and initialMetadata are how your own details get into the Runtime panel — which backend this build points at, which release train it belongs to, which flag cohort the session is in. They are displayed as-is and never leave the device.

Redaction

The redaction group defines which keys are treated as sensitive when showRawSensitiveValues is false — header names, query parameters, body fields and metadata keys. Extend it with anything your own API uses that is not a standard credential header.

Redaction does not apply to mock rules

Rules are configuration a developer wrote, so they are stored exactly as written, in the internal database, in your mocks.json and in the mirror file. Keep real credentials out of mock response bodies.

Two profiles worth copying

A developer's own build

This is the default, and there is nothing to write. Everything visible, everything editable, mocking available, notifications on.

A build for a wider QA or business audience

Read-only, quieter, and unable to rewrite traffic — while still capturing everything needed for a good bug report.

A controlled QA profile
AppInspect.install(
    application = this,
    configuration = AppInspectConfiguration(
        enablement = AppInspectEnablement(
            allowedBuildTiers = linkedSetOf(AppInspectBuildTier.DEBUG),
        ),
        entryPoints = AppInspectEntryPoints(
            shakeToOpenEnabled = true,
            launcherShortcutEnabled = false,
            networkNotificationsEnabled = false,
        ),
        panels = AppInspectPanels(
            crashesEnabled = true,
            mocksEnabled = false,
        ),
        powerTools = AppInspectPowerTools(
            showRawSensitiveValues = false,
            allowSharedPreferencesEditing = false,
            allowDatabaseEditing = false,
            allowSqlConsole = false,
            allowResponseMocking = false,
        ),
    ),
)

Defaults at a glance

  • Raw sensitive values are visible in an enabled build.
  • Build-tier gating decides whether the library runs at all, regardless of configuration.
  • Production is opt-in and off, and needs two separate flags shipped in the APK.
  • WorkManager inspection is read only and cannot be made writable.
  • SharedPreferences and host database editing are on, and configurable.