[原则]Android logcat 抓取日志方法介绍

[原则]Android logcat 抓取日志方法介绍 

一 Android logcat 抓取日志方法介绍具体操作步骤如下:

1、安装adb命令(略); 

2、将手机与电脑连接,然后在运行cmd下面输入:  adb devices,检查连接的手机是否ok;

3、adb shell后,输入指令 logcat -f /mnt/sdcard/m******1.log;

4、需要将手机日志导到电脑中的c盘时,输入 adb pull /mnt/sdcard/m******1.log  c:    

二 Android 文件和日志操作方法

2.1 文件操作

1、从电脑发文件到手机

adb push <本地路径> <远程路径>

2、从手机下载文件到本地

adb pull <远程路径> <本地路径>

2.2 日志操作

1、输出到手机存储卡

adb logcat > /sdcard/mylogcat.txt

2、输出到电脑上
adb logcat > C:/mayingbao/ test.txt(test.txt必须在电脑上存在,才能写入logcat内容)

原文地址:https://www.cnblogs.com/mayingbao/p/4594744.html