zoukankan      html  css  js  c++  java
  • 批处理bat 之 导出Android车机和T-Box的日志

    背景:

    T-Box与Android车机相连接,Android车机与PC相连接,Android车机系统可以通过adb shell命令访问T-Box系统。

    实现功能:

     将T-Box log和Android车机log,导出到PC电脑中。

    代码:

    @echo off
    
    if "%time:~0,1%"==" " set "time=0%time:~1%"
    set date_folder=%date:~0,4%-%date:~5,2%-%date:~8,2%
    set time_folder=%time:~0,2%-%time:~3,2%-%time:~6,2%
    set log_folder="%date_folder%-%time_folder%"
    
    if NOT EXIST %date_folder% md %date_folder%
    cd %date_folder%
    md %log_folder%
    
    :main
    echo %log_folder%
    echo Please choose execution:
    echo     1.hu_log
    echo     2.tbox_log
    echo     0.exit:
    
    set /p choose=Please input choose: 
    if %choose%==1 goto hu_log
    if %choose%==2 goto tbox_log
    if %choose%==0 exit
    pause
    
    :hu_log
    echo Start exporting HU log ...
    ::pull HU log to PC
    adb pull /data/logcat ./%log_folder%
    echo Export HU log completion.
    pause
    goto main
    
    :tbox_log
    echo Start exporting tbox log ...
    ::delete old folder tbox_log
    adb shell rm -rf /sdcard/tbox_log
    ::create a new folder tbox_log
    adb shell mkdir -p /sdcard/tbox_log
    echo Step1:pull tbox log to HU
    adb shell adb pull /mnt/log/. /sdcard/tbox_log
    echo Step2:pull tbox log to PC
    adb pull /sdcard/tbox_log ./%log_folder%
    ::delete sdcard tbox log
    adb shell rm -rf /sdcard/tbox_log
    echo Export tbox log completion.
    pause
    goto main
  • 相关阅读:
    SpringMVC基础知识
    git pull 和git fetch的区别
    动态规划的原理?
    为什么要使用volatile修饰呢?
    内部类,匿名内部类?
    什么是性能优化?
    如何定位CPU瓶颈?
    什么是程序的耦合?
    什么是性能优化?
    Class类的常用方法?
  • 原文地址:https://www.cnblogs.com/zinthewind/p/14174152.html
Copyright © 2011-2022 走看看