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
- Ship release builds from your release pipeline only; testOnly is set by IDE "Run" installs, not proper builds.
- 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 appReferences
Related checks (M8)
- JavaScript obfuscation in the build
- Export compliance (ITSAppUsesNonExemptEncryption) not declared
- HealthKit app that also ships an ads SDK
- Hardcoded unlock or promo code
- Purchases SDK configured with an empty or test key
- Purchase screen falls back to made-up prices or 'coming soon' text
- False-urgency copy on a purchase screen
- Hardcoded price on a purchase screen