[Android] how to clear app data before test

Thanks very much,
I am using Java with JUnit.
I could try something similar.
So you suggest to create a method that executes a shell command before the test?