I think @MoMo did something like this to have log output in the command window:
In your test class, define a function:
private void out(String str) { Bundle b = new Bundle(); b.putString(Instrumentation.REPORT_KEY_STREAMRESULT, "\n" + str); InstrumentationRegistry.getInstrumentation().sendStatus(0, b); }
Then just use it in the @Test functions, for example:
out("Some message...");
The output appears when you run the test in the command window using the adb shell am ... tool, but it does not appear in the Run window of Android Studio. It somehow filters the output of the test runs, and I cannot find a parameter to change this filter.
gregko
source share