saerya
Last Updated: February 25, 2016
·
1.042K
· handtwerk
89eda15e6035c389763e66797485200e

Re-route Android log output when using Robolectric

By default, the output of Android's Log class is swallowed when tests are run by Robolectric. This can be avoided by setting the robolectric.logging system property. The following alternatives are available:

  • stdout
  • stderr
  • A path to a custom log file

The last option is especially useful for retaining log files, e.g. by dynamically constructing the file name from test name, date, etc.

Say Thanks
Respond