# -*- coding: utf-8 -*
import os
from subprocess import Popen, PIPE
def devices():
'''
获取设备信息,根据不同状态给出返回值
1. 未连接设备时,返回值为 0
2. 已连接仅一台设备时,返回值为 1
3. 已连接多台设备时,返回值为 2
'''
print('devices')
resp = Popen('adb devices', shell=True, stdout=PIPE, stderr=PIPE).stdout.readlines()
cmd = []
for i in resp:
cmd.append(i.strip(b'\r\n'))
if cmd[-2] == cmd[0]:
print('...... Devices not fond ......')
return 0
elif len(cmd) > 3:
print('......Found % devices.....' % (len(cmd) -2))
return 2
else:
print('......Devices is found......')
return 1
def analysis_bugreport():
'''
获取Bugreport,并进行分析
'''
print('getting bugreport')
os.system('adb shell bugreport > %s\\bugreport.log' % os.getcwd())
print('Got it')
#Bugreport
os.system('java -jar chkbugreport-0.5-216.jar bugreport.log')
print('Analysis complete')
if __name__ == '__main__':
result = devices()
if result == 1:
analysis_bugreport()
# raw_input('Press Enter key to continue......')
ChkBugReport工具.rar
5星 · 超过95%的资源 需积分: 50 189 浏览量
2019-10-26
14:23:57
上传
评论
收藏 851KB RAR 举报
IT先森
- 粉丝: 4187
- 资源: 70
最新资源
- Python大作业:音乐播放软件(爬虫+可视化+数据分析+数据库)
- 课程设计-python爬虫-爬取日报,爬取日报文章后存储到本地,附带源代码+课程设计报告
- 软件和信息技术服务行业投资与前景预测.pptx
- 课程设计-基于SpringBoot + Mybatis+python爬虫NBA球员数据爬取可视化+源代码+文档+sql+效果图
- 软件品质管理系列二项目策划规范.doc
- 基于TensorFlow+PyQt+GUI的酒店评论情感分析,支持分析本地数据文件和网络爬取数据分析+源代码+文档说明+安装教程
- 软件定义无线电中的模拟电路测试技术.pptx
- 软件开发协议(作为技术开发合同附件).doc
- 软件开发和咨询行业技术趋势分析.pptx
- 软件测试题详解及答案.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈