Capture log files tested by ANDROID apps

Source: Internet
Author: User
Tags dmesg

Capture log files tested by ANDROID apps
1. Introduction to log file classification: logcat main, logcat radio, logcat events, tcpdump, and QXDM log status information on the Qualcomm platform: adb shell cat/proc/kmsg, adb shell dmesg, adb shell dumpstate, adb shell dumpsys, adb bugreport, project mode and other 2 LOG Capture details l real-time printing adb logcat-B main-v time> app. log prints the logadb logcat-B radio-v time> radio of the application. log prints rf-related logs, sim stk will also be in it, modem-related ATcommand and so on, of course, far from QXDM. Adb logcat-B events-v time prints logs of system events, such as touch-screen events... // Android log Capture adb logcat // kernel log Capture adb shell cat/proc/kmsg // Save the log information mkdir/data/anrlogcat *: v>/data/anr/androiddemsg>/data/anr/kernel // press ctrl + c to end log output adb pull/data/anr. /log/tcpdump is very useful. You can use this method for TCP/IP protocols. adb shell tcpdump-s 10000-w/sdcard/capture. pcap, such as the UA profile during mms download, the APN download Using proxy when browser is surfing the internet, and the streaming-related content including UA profile. The last is the QXDM of the Qualcomm platform. Whether it is Android or not, as long as the Qualcomm chip is used, it will be very familiar with it. Of course, if it is not a Qualcomm chip, you don't need to mention it. I don't want to talk about it much. It's rich in content, such as RF, telephone, and Internet access. All the solutions provided by Qualcomm can be grasped. (For the LOG Capturing Method of QXDM, see the basic instructions and functions of QPST and QXDM.) l state information o bugreport (command adb bugreport> bugreport. log ). The bread contains dmesg, dumpstate, and dumpsys. O dumpstate is the system status information, which is comprehensive, including the current memory information, cpu information, logcat cache, and kernel cache of the mobile phone. O adb shell dumpsys: The content about the system service is included in this. This command has more detailed usage. For example, adb shell dumpsys meminfo system is used to view the memory information of the process of system. O kmsg captures adb shell cat/proc/kmsg> kmsg.txt, and then queries the msm_kgsl field Description: used to retrieve kernel messages generated by printk. At any time, only one Super User-authorized process can read the file. You can also use the system to call syslog To retrieve these messages. You can use the dmesg tool or the klogd daemon to retrieve these messages. Proc is a memory file system. Each time you read a file, kmsg is actually a circular buffer inside the kernel. After each read, the circular buffer is considered to have been processed (that is, it turns into invalid content), so it is normal for you to read it empty again. Why is it so much like this? The circular buffer size is limited, the kernel may write something into it at any time, so this process is normal. check whether/proc/kmsg information is associated with system logs. If yes, you can read the log file o dmsg to capture adb shell dmesg> dmesg.txt description: dmesg is used to display the boot information. The kernel stores the boot information in the ring buffer. You can use dmesg to view the information if you cannot view it at startup. Dmesg is the log of the kernel. Any problems related to the kernel, such as driver (camera, Bluetooth, usb, startup, etc.) are also stored in the/var/log directory, file named dmesg. For more/var/log/dmesg o engineering mode, log Capture. For the Apollo mobile phone, call * #* #8888 # *, and select the corresponding LOG. After the test is complete, export the LOG to the PC through the SD card. 3. log Analysis: Get Log from Android Systemadb bugreport> bugreport.txt copy bugreport to the current directory. bugreport contains various log information. Most logs can be directly obtained by running related programs. the procedure is as follows: 1.adb shell 2. go to the related tool program directory 3. run related programs 4. the output process is as follows: 1.adb shell 2. input ps-P 3. you can see the relevant process information Log Archive Analysis 1. bugreport records the log of the android startup process and the system status after startup, including the process list, memory information, VM information, and so on. you can use cat commands to view data separately, such as cat/proc/memin. Fo 2. bugreport structure analysis (1) dumpstate memory info get this log: Read the file/proc/meminfo system MEMORY usage status cpu info get this log: run/system/bin/top-n 1-d 1-m 30-t system CPU usage status PROCRANK to obtain the log: run/system/bin/procrank to execute/system/xbin/procrank and then output the result. check some MEMORY usage status virtual memory stats to obtain the log: when file/proc/vmstat is read, The vmalloc applied memory is located in vmalloc_start ~ There is no simple Conversion Relationship Between vmalloc_end and physical addresses. Although they are logically continuous, they do not require continuity physically. Vmalloc info: Read File/proc/vmallocinfo virtual memory allocation situation slab info get this log: Read File/proc/slabinfo SLAB is a memory distributor. here, we output some information about the distributor. ZONEINFO: Read the file/proc/zoneinfo zone info SYSTEM log (which needs to be analyzed) to obtain the LOG: run/system/bin/logcat-v time-d *: v to output the Log in the program. It is used to analyze the current state of the system. vm traces gets the log: read the file/data/anr/traces.txt because each program runs in its own VM, this Log is actually obtained by some traces event log tags of their respective VMS: read the file/etc/event-log-tags event log to get the log: Run/syst Em/bin/logcat-B events-v time-d *: v outputs the log RADIO LOG of some events to obtain the log: run/system/bin/logcat-B radio-v time-d *: v to display the connection status of some wireless devices, such as GSM, PHONE, STK (Satellite Tool Kit )... Network state to get the log: Run/system/bin/netcfg (get the NETWORK link status) to get the log: Read the file/proc/net/route (get the route status) display the network link and the routing system properties to obtain the log: refer to the code implementation to display some system properties, such as Version, Services, network... Kernel log to get the log: Run/system/bin/dmesg to display the Log kernel wakelocks output by the Android KERNEL to get the log: read File/proc/wakelocks KERNEL some records of program and service wake-up and sleep kernel CPUFREQ (Linux KERNEL CPUfreq subsystem) clock scaling allows you to change the clock speed of the CPUs on the fly. this is a nice method to save battery power, because the lower the clock speed is, the less power the CPU consumes. PROCESSES: Execute ps-P to display the current process PROCESSES Nd threads: Execute ps-t-p-P to display the current process and the thread LIBRANK to get the log: run/system/xbin/librank to remove unnecessary library binder failed transaction log to get the log: Read the file/proc/binder/failed_transaction_log binder transaction log to get the log: read File/proc/binder/transaction_log binder transactions get this log: Read File/proc/binder/transactions binder stats get this log: read File/proc/binder/stats binder process state to get this log: Read File/proc/binder/proc/* bind related status FI LESYSTEMS obtains the log: Some capacity usage status (cache, sqlite, dev…) of the main/system/bin/df files to be executed ...) Package settings: reads the status (access permission, path…) of the package in the file/data/system/packages. xml system ...), It is similar to some lnk files in Windows. package uid errors to get the log: Read the file/data/system/uiderrors.txt

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.