Android JNI: How to see error messages from printf, fprintf and perror?

By default, stdout and stderr get send to /dev/null.

Up vote 0 down vote favorite share g+ share fb share tw.

This may be a simple problem but I am not able to find a solution. I am trying to print error messages to figure out errors in my C++ code in JNI. I have calls to printf, fprintf() and perror() but I cannot find where they are being printed.

I have looked inside adb logcat and it is not there (which makes sense). I found a few links that told me to #define LOG... and then use LOG's functions but I would prefer to stick with the initial fprintf and perror. Is there a way for me to see those messages in an easy way please?

Thank you very much! Android error-message jni link|improve this question asked Oct 22 '11 at 5:48Jary1616 100% accept rate.

By default, stdout and stderr get send to /dev/null. A solution I found was to run: adb shell stop adb shell setprop log. Redirect-stdio true adb shell start from developer.android.com/guide/developing/t... This didn't work for me for some strange reason.

I decided to use #define of LOG... Thanks.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions


Thank You!
send