The documentation for instrument
is clear on how to filter a single test annotation from a test run:
Filter test run to tests without given annotation: adb shell am instrument -w -e notAnnotation com.android.foo.MyAnnotation com.android.foo/android.test.InstrumentationTestRunner
(from https://developer.android.com/reference/android/test/InstrumentationTestRunner.html)
Is it possible to filter multiple annotations? I have not found a syntax that works thus far. I have tried:
adb shell am instrument -w -e notAnnotation com.android.foo.MyAnnotation -e notAnnotation com.android.foo.AnotherAnnotation com.android.foo/android.test.InstrumentationTestRunner
adb shell am instrument -w -e notAnnotation com.android.foo.MyAnnotation,com.android.foo.AnotherAnnotation com.android.foo/android.test.InstrumentationTestRunner
adb shell am instrument -w -e notAnnotation com.android.foo.MyAnnotation com.android.foo.AnotherAnnotation com.android.foo/android.test.InstrumentationTestRunner
adb shell am instrument -w -e notAnnotation "com.android.foo.MyAnnotation","com.android.foo.AnotherAnnotation" com.android.foo/android.test.InstrumentationTestRunner
and probably others that I've forgotten, thus far to no avail.
Anyone know how to do this?
You should be using AndroidJUnitRunner anyway: