日志提取(Android/debug日志)(日常学习笔记)

编程知识 更新时间:2023-04-17 19:25:33

一.debug日志提取
1.手机连接上电脑:开启文件传输
2.打开手机内部共享存储空间:例如 此电脑\GM1910\内部共享存储空间\Android\data
  再找到对应apk文件名字进入\files;即可看到debug.log 文件
PS:提取debug日志、查看日志,一般可定位到需要的问题相关信息

二.Android日志提取

logcat 
1.下载logcat ;解压工具logcat.zip
2.手机连接电脑,打开手机USB调试功能,运行工具内的双击此抓LOG.bat程序
3..手机启动APK,操作【这时操作过程相关的完整日志都被抓取下来】
4.把工具里LOG文件夹下的log文件取出来
logcat PS:
1.华为(包括荣耀)、魅族、360手机需要打开log输出等级后再抓log
log输出等级打开方式:
华为手机打开log输出等级进入拨号界面输入:*#*#2846579#*#*  依次选择ProjectMenu---后台设置----LOG设置---AP日志 点击打开
华为平板打开输出等级详见:https://jingyan.baidu/album/4d58d541580f189dd4e9c0f5.html?picindex=7
魅族详见:http://www.tuicool/articles/zAv2Ar3 
360手机: 进入拨号,输入*20121220#进入工程模式  参考:http://bbs.360/thread-14819862-1-1.html         
2.logcat日志查看:
--------- beginning of system 开始
组成:时间+进程+线程 +优先级(V:最低优先级 D:Debug I:信息 W:警告 E:错误 F:严重错误  S:最高基本)+标签+正文


adb 
1.安装:
将名称中含有adb的文件,和fastboot.exe复制到 c:/windows/system32目录
将名称中含有adb的所有文件复制到 c:/windows/system目录
配置环境变量
运行中输入cmd点击确定,输入adb version 查看版本


2.手机连接电脑,打开手机USB调试功能;输入adb devices 查看手机是否连接。
3.在命令窗口输入:adb logcat -v time>D:log.txt(adb logcat -d > D:\zjblaji.txt),然后运行需要测试的app,完成后按CTRL+C;在D盘就可以看到生成的日志文件


 

4.注意模拟器的话:在cmd窗口执行 adb connect 127.0.0.1:7555【7555:mumu模拟器端口】;再执行 adb shell logcat -v threadtime>1.log 进行抓日志 

PS:
scripting:
  adb wait-for-device          - block until device is online
  adb start-server             - ensure that there is a server running
  adb kill-server              - kill the server if it is running
  adb get-state                - prints: offline | bootloader | device
  adb get-serialno             - prints: <serial-number>
  adb get-devpath              - prints: <device-path>
  adb status-window            - continuously print device status for a specified device
  adb remount                  - remounts the /system and /vendor (if present) partitions on the device read-write
  adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
  adb reboot-bootloader        - reboots the device into the bootloader
  adb root                     - restarts the adbd daemon with root permissions
  adb usb                      - restarts the adbd daemon listening on USB
  adb tcpip <port>             - restarts the adbd daemon listening on TCP on the specified port
 

更多推荐

日志提取(Android/debug日志)(日常学习笔记)

本文发布于:2023-04-14 03:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/cb7e5a58924d564d7a0c85cf407898a9.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日志   学习笔记   日常   debug   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 74490文章数
  • 14阅读数
  • 0评论数