下载资源后端资源详情
auto-logcat.zip
大小:11.63MB
价格:10积分
下载量:0
评分:
5.0
上传者:weixin_41618749
更新日期:2025-09-22

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

资源文件列表(大概)

文件名
大小
auto-logcat/
-
auto-logcat/__pycache__/
-
auto-logcat/__pycache__/screencap.cpython-36.pyc
1.21KB
auto-logcat/get_log.py
4.35KB
auto-logcat/log/
-
auto-logcat/log/20201013152402/
-
auto-logcat/log/20201013152402/20201013152402.png
448.42KB
auto-logcat/log/20201013152402/awlog/
-
auto-logcat/log/20201013152402/awlog/Kernel.log
-
auto-logcat/log/20201013152402/awlog/logcat-all.log
1.58MB
auto-logcat/log/20201013152402/awlog/logcat-crash.log
34.52KB
auto-logcat/log/20201013152402/awlog/logcat-events.log
335.25KB
auto-logcat/log/20201013152402/awlog/logcat-main.log
390.52KB
auto-logcat/log/20201013152402/awlog/logcat-radio.log
444.95KB
auto-logcat/log/20201013152402/awlog/logcat-system.log
386.76KB
auto-logcat/log/20201013152402/awlog/logcat.log
4.35MB
auto-logcat/log/20201013152402/bugreport-INE-TL00-HUAWEIINE-TL00-2020-10-13-15-24-10.zip
3.84MB
auto-logcat/log/20201013152402.zip
5.23MB
auto-logcat/log/GET-LOGS_20201013152402.log
762B
auto-logcat/resource/
-
auto-logcat/resource/__init__.py
-
auto-logcat/resource/__init__.pyc
141B
auto-logcat/resource/__pycache__/
-
auto-logcat/resource/__pycache__/__init__.cpython-36.pyc
134B
auto-logcat/resource/__pycache__/__init__.cpython-37.pyc
155B
auto-logcat/resource/__pycache__/logger.cpython-36.pyc
1.77KB
auto-logcat/resource/__pycache__/logger.cpython-37.pyc
1.79KB
auto-logcat/resource/aapt
1.32MB
auto-logcat/resource/aapt.exe
1.55MB
auto-logcat/resource/logger.py
1.6KB
auto-logcat/resource/logger.pyc
2.29KB
auto-logcat/screencap.py
1.1KB
auto-logcat/screencap.pyc
1.5KB

资源内容介绍

Android-自动抓取日志工具 v1.0
# -*- coding: utf-8 -*-# Author: jiangjialinimport sysimport timefrom screencap import screencapfrom 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 <logcat-{}> 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 <Kernel> 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 <ANR> 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 <tombstones> 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 <misc_logd> 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 <misc_bluetooth> 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 <bugreport> 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()

用户评论 (0)

发表评论

captcha