Previously, when I used application development in the android simulator, I used the ADB shell to enter the shell of the simulator. The current user is the root user, and there is no need for that.
Today, I met a colleague who took the real machine for testing and found that the shell is not the root identity. At this time, my colleague is planning to enable logcat logs. It is estimated that he has read the online log modification switch method:
------------------------------------------
Echo 1>/sys/kernel/logger/log_main/enable
Note: 1 is written to the log switch file, 1 is on, and 0 is off.
Echo 2>/sys/kernel/logger/log_main/Priority
Description: writes level 2 to priority files.
------------------------------------------
However, this operation cannot be executed because it is not root after the shell is entered.
Because I have been playing Linux for a long time, I thought about the Su and sudo methods to switch to the root, but the result still failed. Later I remembered that in this embedded system, busybox is generally used for shell, and there is no Su and sudo mechanism in Linux.
Later, when I was looking at the ADB user guide, I suddenly found that the ADB parameter can contain the root, so that I could enter the shell with the root permission. It's really a bit left alone. In the future, I will take a look at the official reference documents and manuals.
In addition, I attached a post by the blog site netizen to solve the problem that logcat does not produce logs:
Http://www.cnblogs.com/mahang/archive/2011/09/06/2168861.html