1

I want to log error messages of my own app by using logcat, similar to how I can do it on Unix, like

adb logcat *:E | grep com.example.demo

My question is:

1.how to make it on windows?

2.Is there a way can be used in both platform(unix and windows) easily?

Thanks for your answer in advance.

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
starkshang
  • 8,228
  • 6
  • 41
  • 52

2 Answers2

3

Thanks to all gave efforts to this question,I think I have found method to solve this,

On unix:

adb logcat *:E | grep com.example.demo

On Windows:

adb logcat *:E | find "com.example.demo"
starkshang
  • 8,228
  • 6
  • 41
  • 52
2

The grep command is available in Android shell. You could use it instead and it will work on both Windows and Linux.

adb shell "logcat *:E | grep com.example.demo"
Heitor Paceli
  • 493
  • 6
  • 16