Running Android unit / instrumentation tests from the console

Unit tests

Here’s a few handy commands if you want to run only a specific unit test(s). Suppose we have the following unit tests in the project:

./gradlew test – run unit tests for all variants
./gradlew testDebug – run tests for Debug variant
./gradlew testDebug --tests="*.helpers.*" – run all tests in the helpers package
./gradlew testDebug --tests="*.HelperTest" – run all tests in class
./gradlew testDebug --tests="*.getHelp" – run only the getHelp test method.
read more

60 day running challenge

Today I took up a 60 day running challenge. It’s super simple – I need to run 60 consecutive days to succeed. I took up the challenge mainly for 2 reasons:

  • To give myself a lesson in persistence, which I truly believe is the most important factor to success in any field or undertaking.
  • Health benefits – I don’t expect to become a model, but should see some (minor) weight loss and boost in my overall energy levels and endurance.
  • Fun – experienced runners say running can be fun. Currently I don’t see how this can be true, but let’s put it to the test.

Well today I did get to Primrose Hill and backwards, so let’s say run 00 to be completed.