I noticed that when testing plain Java classes via test classes derived from TestCase
and AndroidTestCase
, LogCat output disappears.
Is it possible to still capture the output of these messages? or my only recourse is to use the much more sluggish ActivityInstrumentationTestCase2<>
as a base class?
I had similar issue... The point here is that the logcat view available in Eclipse does not show anything when running the project in Android Junit mode. At least, in the Android 2.1 that I was using, that's the behavior.
You can workaround this issue by checking the logcat from command line (terminal window):
# check the device name you are using
# It gives something like this:
$ ./adb devices
List of devices attached
emulator-5554 device
# open logcat of the device
$ ./adb -s emulator-5554 logcat
D/AndroidRuntime( 943):
D/AndroidRuntime( 943): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 943): CheckJNI is ON
.
.
.
Both of these statements produce log in logcat:
android.util.Log.d(TAG, "This is Log.d");
System.out.println("This is System.out.println");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With