Running adb install app-debug.apk only to be blocked by Failure [INSTALL_FAILED_TEST_ONLY] occurs because Android Studio automatically adds android:testOnly="true" to the AndroidManifest.xml of debug builds to prevent test APKs from being installed on production devices.
Method 1: Allow Test Packages in ADB (adb install -t)
Pass the -t (allow test packages) flag to adb install:
# Install test-only APK using -t flag
adb install -t app-debug.apk
# Output: SuccessMethod 2: Disable testOnly Flag in gradle.properties
# Prevent Android Studio from injecting android:testOnly into debug APKs
android.injected.testOnly=false
Comments and corrections