Enter ADB shell as root

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.