android – Cant run instrumentation with InstrumentationRunListener-ThrowExceptions

Exception or error:

I am trying to run android instrumentation tests with a custom run listener

Here is my listener
this class resides in the folder app/src/androidTest/java/com/app/myapp

class AnnotationTestListener : InstrumentationRunListener() {
    override fun testStarted(description: Description) {
        val bundle = Bundle()
        instrumentation.sendStatus(InstrumentationResultPrinter.REPORT_VALUE_RESULT_START, bundle)


then I am trying to invoke the instrumentation listener the following way

adb shell am instrument -w -r -e log true -e listener | tee -a listeners/test.txt

but the result is

INSTRUMENTATION_RESULT: shortMsg=Process crashed.

adb shell pm list instrumentation yields

instrumentation:androidx.test.orchestrator/.AndroidTestOrchestrator (target=androidx.test.orchestrator) (

How to fix the problem?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *