准备工作:
1.安装QXDM5
2.配置adb 环境变量
3.使用python 3以上
4.完成代码如下
import sys
import time
import os
if sys.platform.startswith("linux"):
sys.path.append('/opt/qcom/QXDM/Support/python')
elif sys.platform.startswith("win"):
sys.path.append('C:\Program Files (x86)\Qualcomm\QXDM5\Support\python') #QXDM5的默认路径
sys.path.append('C:\Program Files (x86)\Qualcomm\QUTS\Support\python')
elif sys.platform.startswith("darwin"):
sys.path.append('/Applications/Qualcomm/QUTS/QUTS.app/Contents/Support/python')
import QutsClient
import QxdmAutomationClient
import QxdmAutomationService.ttypes
class deviceManager(object):
#通过模块的devicesID获取QXDM需要连接设备的devicehandle, protocolHandle
def getDeviceInfo(self,devid,getPortName="Diagnostics"):
protocolHandle = ""
deviceHandle = ""
comport = ""