alibaba / mobileperf

Android performance test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

androiddevice.py在py3.7-pycharm中打开报错

Valuebai opened this issue · comments

image
问题如下:

  • 这里的super(RemoteADB 报错了,这块为啥要super呢?
  • from androiddriver.adb import RemoteADB ——这个也报错,androiddriver.adb是在哪里的呢,源码没看到哈
class RemoteADB(ADB):
    '''网络远程ADB
    '''

    def __init__(self, device_id):
        super(RemoteADB, self).__init__(device_id)
        from androiddriver.adb import RemoteADB

image
另外,下面的unicode在pychram中也有报错的

    def install_apk(self, apk_path, over_install=True, downgrade=False):
        '''安装应用
            apk_path 安装包路径
            over_install:是否覆盖暗账
            downgrade:是否允许降版本安装
        '''
        if isinstance(apk_path, unicode):

直接执行cpu.py报错

C:\python37\python.exe D:/codePython/mobileperf/mobileperf/android/cpu.py
path:D:\codePython\mobileperf
[2020-06-12 18:04:44,416]DEBUG:mobileperf:androiddevice:b'List of devices attached\r\nGDB6R19A16004316\tdevice\r\n\r\n'
[2020-06-12 18:04:44,427]DEBUG:mobileperf:androiddevice:system have adb
[2020-06-12 18:04:44,430]DEBUG:mobileperf:cpu:INFO: CpuCollector  started...
[2020-06-12 18:04:44,430]DEBUG:mobileperf:cpu:INFO: CpuMonitor has started...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\python37\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\python37\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "D:/codePython/mobileperf/mobileperf/android/cpu.py", line 124, in _collect_cpu_thread
    cpu_file = os.path.join(RuntimeData.package_save_path, 'cpuinfo.csv')
  File "C:\python37\lib\ntpath.py", line 76, in join
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType


具体代码行
    # @profile
    def _collect_cpu_thread(self,start_time):
        end_time = time.time() + self._timeout
        cpu_title = ["datetime", "device_cpu_rate%", "user%", "system%"]
        cpu_file = os.path.join(RuntimeData.package_save_path, 'cpuinfo.csv') ——这个
commented

cpu采集用的cpu_top.py,cpu.py已删除,RemoteADB,unicode 无用代码已删除