Log file crawl for Android app test

Source: Internet
Author: User
Tags dmesg

1 Log File Classification introduction

The main real-time printing is: Logcat main,logcat radio,logcat Events,tcpdump, there will also be a high-pass platform QXDM Log

Status information: adb shell cat/proc/kmsg, adb shell dmesg,adb shell dumpstate,adb Shell dumpsys,adb Bugreport, engineering mode, etc.

2 Log Crawl Details

L Real-time printing

ADB logcat-b main-v time>app.log  Printing application logadb logcat-b radio-v time> radio.log print RF related LOG,SIM STK will also be inside, mode M-related atcommand, of course, and QXDM is very far from the poor. ADB logcat-b events-v time  Print system event log, such as touch-screen event ... Android log crawl adb logcat//kernel log crawl adb shell Cat/proc/kmsg//log info save mkdir  /data/anrlogcat *:v >/data/anr /androiddemsg >/data/anr/kernel//Press CTRL + C to end the log output adb pull/data/anr./log/

Tcpdump is useful for TCP/IP protocol-related can use this to catch, adb shell tcpdump-s 10000-w/sdcard/capture.pcap, such as the capture MMS download when the UA profile, Browser The Internet, the use of proxy APN download, streaming related content including UA profile.

Finally, Qualcomm platform QXDM, whether it is not Android, as long as the use of high-pass chip, will be familiar with it, of course, not Qualcomm chip will not have to mention it. This is not much to say, rich content, radio frequency, telephone, Internet, ... All Qualcomm offers the solution, this can be caught. (QXDM log Crawl method, please refer to Qpst, QXDM basic instructions and functions of use)

L Status information

o bugreport (command adb bugreport>bugreport.log). It contains Dmesg,dumpstate and Dumpsys.

o Dumpstate is the system status information, which is more complete , including the current memory information, CPU information, Logcat cache, kernel cache and so on.

o adb shell Dumpsys This is what the system service is all about, and this command has a more detailed usage, such as the ADB shell Dumpsys meminfo system, which is the memory information for viewing system process.

o kmsg Crawl

adb shell cat/proc/kmsg > kmsg.txt, open to check Msm_kgsl field

Description: Used to retrieve kernel messages generated with PRINTK. Only one process with superuser privileges can read this file at any time. These messages can also be retrieved using System invoke syslog. These messages are typically retrieved using the tool DMESG or daemon klogd. Proc is a memory file system, each read file kmsg is actually a loop buffer inside the kernel, after each read, the loop buffer thing is considered to have been processed (that is, to become invalid content), so you read again empty is very normal why this process, the loop buffer size is limited, The kernel can write to it at any time, so it's normal to handle it. You go find out if/proc/kmsg's information is associated with the system log, and if so, you can read the log file.

o dmsg Crawl

adb shell DMESG > Dmesg.txt

Note: DMESG is used to display the boot information, kernel will store the boot information in the ring buffer. If you are too late to view the information, you can use DMESG to view it. DMESG is kernel log, usually with kernel related, such as driver out of the problem (camera, Bluetooth, USB, boot, etc.) boot information is also saved in the/var/log directory, the name is DMESG file. More/var/log/dmesg

o Capture of Log in engineering mode

For the Apollo phone, call *#* #8888 #*#* and tick the corresponding log. After the test is finished, export log to PC via SD card.

3.Log Analysis:

Get Log from Android systemadb bugreport > Bugreport.txtcopy bugreport to the current directory.

Bugreport contains a variety of log information, most of the log can also be directly run by the relevant program directly to obtain.

The steps are as follows:

1.ADB Shell 2. Enter the directory of the relevant tool program 3. Execute the relevant program 4. Get relevant information

The following is an example of output process information 1.adb Shell 2. Enter Ps-p 3. You can see the relevant process information

Log Archive Analysis

1.bugreport

Bugreport records the log of the Android boot process, as well as the system status after startup, including the process list, memory information, VM information, etc. wait until.

Viewing a single data separately can be viewed using cat commands, such as Cat/proc/meminfo

2.bugreport Structural Analysis

(1) dumpstate

MEMORY INFO

Get the log: Read file/proc/meminfo

System memory Usage Status

CPU INFO

Get the log: Execute/system/bin/top-n 1-d 1-m 30-t

System CPU Usage Status

Procrank

Get the log: Execute/system/bin/procrank

Results of output after executing/system/xbin/procrank, view some memory usage status

VIRTUAL MEMORY STATS

Get the log: Read file/proc/vmstat

Virtual Memory allocation Status

Vmalloc application memory is located between Vmalloc_start~vmalloc_end, there is no simple conversion relationship with physical address, although they are also logically contiguous, but physically they do not require continuous.

Vmalloc INFO

Get the log: Read file/proc/vmallocinfo

Virtual Memory allocation Status

SLAB INFO

Get the log: Read file/proc/slabinfo

Slab is a memory allocator. Here is some information about the output of this allocator

Zoneinfo

Get the log: Read file/proc/zoneinfo

Zone Info

SYSTEM LOG (need to focus on analysis)

Get the log: Execute/system/bin/logcat-v time-d *:v

Outputs the log output in the program to analyze the current state of the system

VM traces

Get the log: Read file/data/anr/traces.txt

Because each program is running in its own VM, this log is some of the traces of the actual VMS

EVENT LOG TAGS

Get the log: Read file/etc/event-log-tags

EVENT LOG

Get the log: Execute/system/bin/logcat-b events-v time-d *:v

Output log of some event

RADIO LOG

Get the log: Execute/system/bin/logcat-b radio-v time-d *:v

Shows the link states of some wireless devices, such as GSM,PHONE,STK (satellite Tool Kit) ...

NETWORK State

Get the log: Execute/system/bin/netcfg (Get network link status)

Get the log: Read file/proc/net/route (get routing status)

Show Network links and routes

SYSTEM PROPERTIES

Get the log: reference code implementation

Displays some system properties, such as version,services,network ...

KERNEL LOG

Get the log: Execute/SYSTEM/BIN/DMESG

Log that shows Android kernel output

KERNEL Wakelocks

Get the log: Read file/proc/wakelocks

Some records of the kernel waking and hibernating some programs and services

KERNEL CPUFREQ (Linux KERNEL CPUFREQ subsystem) clock scaling allows the clock speed of the CPUs on the fly.t He is a nice method to save battery power, because the lower the clock speed is, and the less power the CPU consumes. PROCESSES

  

get the log: Execute ps-p

Show Current process

PROCESSES and THREADS

Get the log: Execute ps-t-p-p

Show current processes and threads

Librank

Get the log: Execute/system/xbin/librank

Eliminate unnecessary library

BINDER FAILED TRANSACTION LOG

Get the log: Read file/proc/binder/failed_transaction_log

BINDER TRANSACTION LOG

Get the log: Read file/proc/binder/transaction_log

BINDER transactions

Get the log: Read file/proc/binder/transactions

BINDER STATS

Get the log: Read file/proc/binder/stats

BINDER PROCESS State

Get the log: Read file/proc/binder/proc/*

Some states related to bind

Filesystems

Get the log: Execute/SYSTEM/BIN/DF

Some capacity usage status for primary files (Cache,sqlite,dev ...)

Package SETTINGS

Get the log: Read file/data/system/packages.xml

Some of the status of the package in the system (access rights, paths ...), similar to some LNK files in Windows .

Package UID ERRORS

Get the log: Read file/data/system/uiderrors.txt

Log file crawl for Android app test

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.