In Android-ndk, we could use “__android_log_write”, “__android_log_print”, … etc to output messages to the “LogCat” window. How about if I use “std::cout” to output some strings ? E.g.
std::cout << "some strings" << std::endl;
Where would the strings be sent.
It seems that Android does not have Console Applications and the above strings may not be sent. Could I redirect the “stdout” to a file so that sending strings to “std::cout” is equivalent to logging messages ?
According to the Android documentation, stdout & stderr output to
/dev/null. You can use the Android Debug Bridge to achieve what you want.The system retains this setting until you terminate the emulator/device instance. To use the setting as a default on the emulator/device instance, you can add an entry to /data/local.prop on the device.