<Android> 实时监控记录Android的Kernel和上层LOG

启动脚本:
MonitorLog.bat

@echo off

set "TO_NUL= >NUL 2>NUL"
set DEBUG=0

if "%1" == "cmd" (
    @echo on
    set DEBUG=1
    set "TO_NUL="
) 

echo Wait for device...
adb wait-for-device

if "%time:~0,1%" == " " (
    set "test_dir=MonitorLog_%date:~0,4%%date:~5,2%%date:~8,2%_0%time:~1,1%%time:~3,2%"
) else (
    set "test_dir=MonitorLog_%date:~0,4%%date:~5,2%%date:~8,2%_%time:~0,2%%time:~3,2%"
)
echo Log Tracing in: %test_dir%
if exist %test_dir%  rd /s /q %test_dir% %TO_NUL%
mkdir %test_dir% %TO_NUL%

start /min cmd /c MonitorKernel.bat  %test_dir% 
call MonitorAndroid.bat %test_dir%
REM start /min cmd /c MonitorKernel.bat  %test_dir%

pause

监控Android Log:
MonitorAndroid.bat

@echo off
adb wait-for-device
echo Android Monitoring...
adb shell logcat >> %1\logcat.txt

监控Kernel Log:
MonitorKernel.bat

@echo off
adb wait-for-device
echo Kernel Monitoring...
adb shell cat /proc/kmsg >> %1\\kmsg.txt

这里写图片描述

这里写图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值