As per this blogpost from CommonsWare, AndroidManifest.xml
file can have an android:testOnly
attribute.
In my AndroidManifest.xml
it is set as "false"
android:testOnly="false"
And I am generating the apk file using the “Build APK(s)” menu option as shown below image,
And when i am trying to install app from command line, adb install -r myapp.apk, I am still getting error,
Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
Android studio version is as below,
What else shall I do to make my app run?
You can also use command like this :
adb install -r -t myapp.apk
it works for me:
PS C:\Users\languoguang> adb -P 12345 install -r D:\GreeneTrans\HelloWorld-signed.apk
adb: failed to install D:\GreeneTrans\HelloWorld-signed.apk: Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
PS C:\Users\languoguang> adb -P 12345 install -t D:\GreeneTrans\HelloWorld-signed.apk
Success
PS C:\Users\languoguang> adb -P 12345 install -r -t D:\GreeneTrans\HelloWorld-signed.apk
Success
PS C:\Users\languoguang>