Android源码,编译之后在开发板中运行,我修改了hardware\ril\rild.c的代码,在main函数中加了LOGD函数打印log,但是使用adb shell logcat查看不到我所打印的信息。google查找原因说是默认情况下, init 执行的程序输出的信息和错误到 /dev/null。如是按照其中的解决方法做了:
1.添加/system/bin/logwrapper,可以用logcat查看,例如
service /system/bin/logwrapper /system/bin/rild
2.添加console,像sh一样直接输出到console
service console /system/bin/sh
console
結果这两种方法都不可行,求解。