Does anyone know how to print stack traces for exceptions caught while running in the Android emulator in Eclipse? I catch the exception and call .p开发者_C百科rintStackTrace() but I cannot find where it is being written. I have tried .printStackTrace(System.out) and .printStackTrace(System.err). I would be nice to be able to direct them to the Eclipse console.
Use logcat
. System.out
and System.err
are redirected to logcat
in Android. Just go to Window -> Show View -> Other -> Android -> Logcat
and you'll get all the logged stuff there.
精彩评论