high · M8 · MASVS-CODE-2 · PTKD-CFG-TESTONLY

    Application marked test-only

    android:testOnly="true" marks a development build (installable only via `adb install -t`); it must never be distributed.

    How it is exploited

    testOnly builds accept instrumentation from test harnesses, so automation frameworks can puppet the app and its data.

    Why it matters

    A build meant for CI leaks to users with instrumentation doors open.

    How to fix it

    1. Ship release builds from your release pipeline only; testOnly is set by IDE "Run" installs, not proper builds.
    2. Add the PTKD build gate to CI so a testOnly binary never reaches a store track.

    Does your app have this?

    PTKD checks your build or your source project for PTKD-CFG-TESTONLY and every other check in this knowledge base.

    Scan your app

    References

    Related checks (M8)