首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

Android-自动抓取日志工具 v1.0

后端 11.63MB 19 需要积分: 1
立即下载

资源介绍:

Android-自动抓取日志工具 v1.0
# -*- coding: utf-8 -*- # Author: jiangjialin import sys import time from screencap import screencap from resource.logger import * # Get python version,int. py_ver_info = sys.version_info.major # Call my logger. module = 'GET-LOGS' logfile = './log/' logger = MyLogger(module, logfile) class GetLogs: """ Get logs: 1. logcat 2. kernel 3. anr 4. tombstones 5. bugreport """ def __init__(self): self.localtime = time.strftime( '%Y%m%d%H%M%S', time.localtime(time.time())) self.local_path = sys.path[0] + "/log/" + self.localtime self.loglst = ['all', 'system', 'radio', 'events', 'main', 'crash'] if not os.path.exists(self.local_path): os.makedirs(self.local_path) def logcat(self, remote_path): """ See logcat --help option for '-b' """ for log_name in self.loglst: os.system('adb shell "rm {}/logcat-{}.log"'.format(remote_path, log_name)) cmd = 'adb shell "logcat -b {} -d > {}/logcat-{}.log"'.format( log_name, remote_path, log_name) logger.info('Getting log ......'.format(log_name)) # Save log to file (Overwrite if the file exists). os.system(cmd) def dmesg_log(self, remote_path): """ Get kernel log, and save to file. """ logger.info('Getting log ......') os.system('adb shell "dmesg > {}/Kernel.log"'.format(remote_path)) # from /data/vendor/kmsgd get kernel log # os.system('adb pull /data/vendor/kmsgd {}'.format(self.local_path)) def anr_log(self, local_path): """ Get ANR log,pull /data/anr all files to local. ANR: Application Not Responding must get it. """ logger.info('Getting for log ......') cmd = 'adb pull /data/anr/ {}/'.format(local_path) os.system(cmd) def tombstones_log(self, local_path): """ Get tombstones log,pull /data/tombstones all files to local. """ logger.info('Getting for log ......') cmd = 'adb pull /data/tombstones/ {}/'.format(local_path) os.system(cmd) def misc_logd(self, local_path): """ Pull /data/misc/logd all files to local. """ logger.info('Getting for log ......') cmd = 'adb pull /data/misc/logd {}/misc/'.format(local_path) os.system(cmd) def misc_bluetooth(self, local_path): ''' Get /data/misc/bluetooth all files to local. about bluetooth issue must get it. ''' logger.info('Getting for log ......') cmd = 'adb pull /data/misc/bluetooth {}/misc/'.format(local_path) os.system(cmd) def bugreport(self, local_path): """ Get bugreport log After the Android 7.x use "adb bugreport +path", export to zip. Previous versions were incompatible. """ logger.info('Getting log ......') # Export bugreport(zip). cmd = 'adb bugreport {}'.format(local_path) os.system(cmd) def take_custom_log(self): """ Get all files in the "/sdcard/awlog/" directory, mainly including custom logs. """ # make custom directory. custom_remote_path = '/sdcard/awlog' os.system('adb shell mkdir {}'.format(custom_remote_path)) logger.info('Getting "/sdcard/awlog/*" log ......') pull_cmd = 'adb pull {} {}/awlog'.format(custom_remote_path, self.local_path) print(pull_cmd) self.logcat(custom_remote_path) self.dmesg_log(custom_remote_path) # Pull log file to local. os.system(pull_cmd) def main(): """ Start get log. """ os.system('adb wait-for-device') os.system('adb remount') os.system('adb root') # Userdebug must use it. get = GetLogs() local_path = get.local_path # take picture. screencap().capture(local_path) get.take_custom_log() # Default don't get following logs,because it's already included in bugreport(zip). # get.anr_log() # get.tombstones_log() # get.misc_logd() # get.misc_bluetooth() # take bugreport. get.bugreport(local_path) logger.info('Has been saved to [%s]' % get.local_path) if __name__ == '__main__': main()

资源文件列表:

auto-logcat.zip 大约有33个文件
  1. auto-logcat/
  2. auto-logcat/__pycache__/
  3. auto-logcat/__pycache__/screencap.cpython-36.pyc 1.21KB
  4. auto-logcat/get_log.py 4.35KB
  5. auto-logcat/log/
  6. auto-logcat/log/20201013152402/
  7. auto-logcat/log/20201013152402/20201013152402.png 448.42KB
  8. auto-logcat/log/20201013152402/awlog/
  9. auto-logcat/log/20201013152402/awlog/Kernel.log
  10. auto-logcat/log/20201013152402/awlog/logcat-all.log 1.58MB
  11. auto-logcat/log/20201013152402/awlog/logcat-crash.log 34.52KB
  12. auto-logcat/log/20201013152402/awlog/logcat-events.log 335.25KB
  13. auto-logcat/log/20201013152402/awlog/logcat-main.log 390.52KB
  14. auto-logcat/log/20201013152402/awlog/logcat-radio.log 444.95KB
  15. auto-logcat/log/20201013152402/awlog/logcat-system.log 386.76KB
  16. auto-logcat/log/20201013152402/awlog/logcat.log 4.35MB
  17. auto-logcat/log/20201013152402/bugreport-INE-TL00-HUAWEIINE-TL00-2020-10-13-15-24-10.zip 3.84MB
  18. auto-logcat/log/20201013152402.zip 5.23MB
  19. auto-logcat/log/GET-LOGS_20201013152402.log 762B
  20. auto-logcat/resource/
  21. auto-logcat/resource/__init__.py
  22. auto-logcat/resource/__init__.pyc 141B
  23. auto-logcat/resource/__pycache__/
  24. auto-logcat/resource/__pycache__/__init__.cpython-36.pyc 134B
  25. auto-logcat/resource/__pycache__/__init__.cpython-37.pyc 155B
  26. auto-logcat/resource/__pycache__/logger.cpython-36.pyc 1.77KB
  27. auto-logcat/resource/__pycache__/logger.cpython-37.pyc 1.79KB
  28. auto-logcat/resource/aapt 1.32MB
  29. auto-logcat/resource/aapt.exe 1.55MB
  30. auto-logcat/resource/logger.py 1.6KB
  31. auto-logcat/resource/logger.pyc 2.29KB
  32. auto-logcat/screencap.py 1.1KB
  33. auto-logcat/screencap.pyc 1.5KB
0评论
提交 加载更多评论
其他资源 c数独小游戏-期末作业
目前游戏还有一点bug: 一、在查看答案之后,可能输入数字的框内会出现数字重叠,这一点博主很懒,就不改了。 二、挖空的合理性,博主只用了随机挖空,那么在游戏的前提下,游戏是不完整的——在已知数字较少的情况下,人脑不一定能完成数独游戏。(已知数独的极限情况下最少要已知27个数字,且有特定情况)
智能蔬菜大棚,使用stm32开发
智能蔬菜大棚,使用stm32开发
智能蔬菜大棚,使用stm32开发 智能蔬菜大棚,使用stm32开发 智能蔬菜大棚,使用stm32开发
嘉特官方网站纯html加css手写
嘉特官方网站纯html加css手写
嘉特官方网站纯html加css手写 嘉特官方网站纯html加css手写 嘉特官方网站纯html加css手写
MQ规格书,方便大家查看
MQ规格书,方便大家查看
网卡驱动,用于驱动815网卡能够使其上网
网卡驱动,用于驱动815网卡能够使其上网
分享我平时经常使用的壁纸
壁纸,平时使用,好看
20769a74-6c5b-4084-b81e-84af7004bf2d_1719786451132.zip
20769a74-6c5b-4084-b81e-84af7004bf2d_1719786451132.zip
会员制医疗预约服务管理信息系统-+论文+源码+讲解+PPT
会员制医疗预约服务管理信息系统-+论文+源码+讲解+PPT