Learn with you for lifeXi, this is Programmer Android
Recommended classic articles. By reading this article, you will gain the following knowledge points:
1. Requirements for capturing the log of the fixed screen crash problem.
2. What to do after the fixed screen crash problem occurs.
3. How to check whether adb can be connected.
4. Connect adb and grab the following log
. 5. If adb cannot be connected, perform the following operations.
6. Black screen dump capture solution
1. Log capture requirements for fixed screen crash problem
1. Use
debug版本
insert4G
and aboveSD卡
.2. Adjust the mobile phone time to the computer time before the test.
3. Keep the vmlinux and symbols folders corresponding to the mobile phone test version
symbols directory:
/out/target/product/XXX平台/symbols
vmlinux directory:/out/target/product/XXX平台/obj/KERNEL/vmlinux
2. What to do after the fixed screen crash problem occurs?
1. Record the time point
2. Take photos and keep the scene
3. Check whether adb can be connected
4. Check whether the call can be connected
3. How to check whether adb can be connected
Connect the mobile phone USB
, execute it adb devices
, and check whether the device can be recognized ID
. If it is successfully recognized, it means adb
it can be connected. Otherwise, please check 5037
whether the port number is occupied. It is recommended to exit various mobile assistants, 360 Security Guard and other software, and try the method multiple times.
adb kill-server
adb start-server
adb root
adb remount
adb devices
adb shell
1.adb kill-server
Kill the PC
terminal adb
process to prevent 5037 disconnection from being occupied by the mobile assistant.
2.adb start-server
Start PC adb
process
3.adb root
Get root
permission
4.adb remount
Mount mobile phone
5.adb devices
View deviceid
6.adb shell
See if you can enter adb shell
. If you can enter, adb
you can connect. Otherwise, you can't.
adb to check whether the phone is mounted successfully and take a screenshot
4. Connect adb to grab the following Log
1. Click
power
the key and capture the key eventKernellog
adb shell cat /proc/kmsg > kernel.log
2.Catch some
adb
scenesLog
adb logcat –v time > logcat.txt
3. Grab
Bugreport
//Android 7.0及以上
adb shell bugreport > bugreport.zip
//Android 5.0 6.0及以下
adb shell bugreport > bugreport.txt
Bugreport
The crawling is slow and you need to wait 3
for about minutes.
4. Captured
system_server
call stack
Capture the call stack information of system_server
1.Connectadb
adb shell
Create a file
touch /data/anr/traces.txt
3. Modify file permissions
chmod 777 /data/anr/traces.txt**
4.Switchroot
su
5. Find system_server
the processid
ps -A | grep system_server
6. id
Kill according tosystem_server
kill -3 13691
7. Screenshot to retain thread
/system/bin/screencap -p > /data/anr/screenshot.png
8. Export trace
information
adb pull /data/anr/traces.txt .
9. If the screen is black and the screen is fixed, you can use this command to check whether the screen can be lit.
echo on > /sys/power/state
Export
panic
file
After triggering panic
, theoretically when the phone restarts, the following two files will be saved in it data
. adb
The commands are as follows:
adb pull /data/dontpanic/apanic_console
adb pull /data/dontpanic/apanic_threads
5. If adb cannot be connected, perform the following operations
1. 音量上
+ 音量下
+ 电源键
(double-click 2 times) to grab sysdump
.
If it doesn't work, please see the second point ( Kernel
alive, triggered by software restart Dump
)
2. Power
Long 7S
press trigger dump
(available on some mobile phones)
3. Long press 音量上
and 电源键
grab at the same time sysdump
( Kernel
dead, triggered by hardware restart sysdump
)
6. Black screen dump capture solution
1. Record the time when the problem occurred
2. adb
Whether it can be connected
. If it can be connected, please execute the following command
adb root
adb remount
adb shell df >> df.txt
adb shell b2g-ps --oom >> b2g_ps.txt
adb shell b2g-info >> b2g-info.txt
adb shell debuggerd -b xxx >> b2g_debuggerd.txt (xxx为b2g_ps.txt中记录的b2g进程号)
adb shell screencap -p /data/1.png
adb shell getevent >> getevent.txt (此时请操作物理按键几次power,上下左右,enter等,看是否按键消息输出)
adb shell screencap -p /data/2.png
adb logcat -v threadtime >> adb_logcat.txt (在logcat执行过程中,再操作几下按键)
adb shell screencap -p /data/3.png
adb shell dumpsys SurfaceFlinger >sf.txt
adb shell dumpsys window > window.txt
3. Make a call to the test machine to see if it responds?
references:
[Tencent Documentation] Android Framework Knowledge Base
https://docs.qq.com/doc/DSXBmSG9VbEROUXF5
Friendly recommendation:
Collection of useful information on Android development
At this point, this article has ended. The editor thinks the article is reprinted from the Internet and is excellent. You are welcome to click to read the original article and support the original author. If there is any infringement, please contact the editor to delete it. Your suggestions and corrections are welcome. We look forward to your attention and thank you for reading, thank you!
Click to read the original article and like the boss!