0

I'm unable to get the detailed description of installation of an apk. I have tried adb install "filename.apk" it showing only success. Is there any way to get full log file while installing or executing ?

Harsha Bm
  • 1
  • 2
  • Possible duplicate of [Android apk does not install? Where can I check the logs for this? No reason is given](https://stackoverflow.com/questions/9405751/android-apk-does-not-install-where-can-i-check-the-logs-for-this-no-reason-is) – Vaibhav Vishal Feb 07 '19 at 04:50
  • https://stackoverflow.com/a/14591006/1778421 – Alex P. Feb 07 '19 at 13:33

1 Answers1

0

When running a UI test on the emulator or device the gradle builds two apk files, one for the app, and one for the testing code. Let’s build both the app and the testing app and install them.

First connect a device or an emulator, and type in the command line in the project folder:

./gradlew clean installDebug installDebugAndroidTest

This command will:

  • clean the build folder
  • compile and install the app on the device
  • compile and install testing app on the device

Now for the fun part. Run the tests from command line:

adb shell am instrument -w -r -e debug false -e class com.your.app.ExampleInstrumentedTest#checkButton com.your.app.test/android.support.test.runner.AndroidJUnitRunner

Let’s explain the above command first:

  • “adb shell am instrument -w” runs all the UI tests
  • “-e debug false” is because we don’t want to debug the testing
  • “-e class com.your.app.ExampleInstrumentedTest#checkButton com.your.app.test/android.support.test.runner.AndroidJUnitRunner” this tells our app to run a specific test
Uriel Frankel
  • 14,304
  • 8
  • 47
  • 69