Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JimmySorza/c029c08df699de10856d88f7e34409da to your computer and use it in GitHub Desktop.
Save JimmySorza/c029c08df699de10856d88f7e34409da to your computer and use it in GitHub Desktop.
Disable 'testOnly' mode for Android Studio 3.0
tags
Android
Android Studio

Disable 'testOnly' mode for Android Studio 3.0

Android Studio 3.0 sets android:testOnly="true" automatically on APKs that are ran from the IDE.

However, for some devices (such as OPPO R11), the test-only APKs can never be installed ...

If you face the same problem, try add this line to your '/gradle.properties':

# gradle.properties
android.injected.testOnly=false

Then the boring android:testOnly attribute disappears. ( ͡° ͜ʖ ͡°)✧


BTW, if you do not have an 'OPPO R11' (congratulations), and just want to install such a test-only app with adb, try:

adb install -t <test_only_apk_filename>.apk

Otherwise, you will get a failure message:

Failed to install app-debug.apk: Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment