Solution for Android mobile phone logcat not displaying output information during development and debugging

Source: Internet
Author: User

I searched for N multiple solutions on the Internet, but many of them set the Log Level and usage to filter and view logs in logcat, however, the problem I encountered was that the simulator was okay, but the log information was not visible during development and debugging on real machines and mobile phones, this is annoying (after all, the simulator runs too slowly ).

If no good method is found at the beginning, try catch to hit the exception to an alertdialog. However, it is useless to look around this circle, finally, I saw the solution on the EOE forum. I am afraid the reason is that Rom itself has not enabled the log switch.

Problem: after connecting the mobile phone to the computer, the driver is correctly installed and the USB debugging mode is enabled. The device and its process information can be seen in ddms, but no information is output in logcat.
Cause: logcat is disabled by default in some rom
Problem description: In ddms, the display of the device name as a question mark does not affect, that is, the display of ADB get-serialno as a question mark does not affect.
Solution:
1. Root permission required (not required for some rom)
2. Open logcat, set the level, and run the following command (after Android upgrade, ADB is in platform-tools, not in tools)
ADB Shell
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.
3. Restart ADB. If eclipse is used, disable eclipse, restart ADB, and then start eclipse.
ADB kill-Server
ADB start-Server
4. logcat should be able to work now. If it still does not work, update ADB
Android update ADB
5. Repeat Step 3. At this time, logcat should be able to work. If it still does not work, find the android directory in your home directory, such as c: \ Documents ents and Settings \ Administrator \. Android.
Find the adb_usb.ini file in this directory. The content of the file is only three lines by default, all of which are comments. Add a line after it and the content is 0x12d1.
6. Repeat Step 3. logcat should be ready to work now.

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.