Android source code debugging

How can I get the cout output of my own C ++ program in developing Android applications in eclipse.

Please help me here.

+3
android android-ndk
Jun 19 '13 at 10:33
source share
1 answer

The file descriptors stdout / stderr are sent to /dev/null in Android applications. (The Java equivalents, System.out and System.err , are redirected to the log using the application platform.)

A hack is included in the Dalvik VM that allows you to see stdout / stderr on the root device by setting the log.redirect-stdio property. See this link for more details. It works by creating a stream that reads from stdio file descriptors and copies the data to the logging system.

For new code, it’s much easier to use Android log calls directly. If you import the library from other sources, this is of course a bit more complicated. If necessary, you can copy the code from Dalvik to your application and do the same.

+5
Jun 19 '13 at 19:28
source share



All Articles