Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac 测试 ios 获取不到cpu 内存 fps数据 #271

Open
yinshipeng opened this issue Mar 1, 2024 · 9 comments
Open

mac 测试 ios 获取不到cpu 内存 fps数据 #271

yinshipeng opened this issue Mar 1, 2024 · 9 comments

Comments

@yinshipeng
Copy link

mac电脑,Apple M2 Pro

solox 2.8.8

iPhone系统是17.3.1

ipad设备是16.6

python是3.12

获取不到cpu 内存 fps数据 network 和gpu,但是能获取到battery

日志如下:

File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/_iosPerf.py", line 36, in init
self._ins = d.connect_instruments()
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 792, in connect_instruments
conn = self.start_service(
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 485, in start_service
self.mount_developer_image()
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 659, in mount_developer_image
with self._request_developer_image_dir() as _dir: #, signature_path:
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 137, in enter
return next(self.gen)
^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 611, in _request_developer_image_dir
image_zip_path = cache_developer_image(version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_imagemounter.py", line 87, in cache_developer_image
raise err
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_imagemounter.py", line 75, in cache_developer_image
_urlretrieve(url, image_zip_path)
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/retry/api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/retry/api.py", line 33, in __retry_internal
return f()
^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_imagemounter.py", line 30, in urlretrieve
r.raise_for_status()
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://tool.appetizer.io/JinjunHan/iOSDeviceSupport/raw/master/DeviceSupport/16.6.zip
127.0.0.1 - - [01/Mar/2024 17:25:13] "GET /apm/fps?model=normal&platform=iOS&pkgname=com.baozun.xpos&device=00008101-000D318A1400801E&surv=false&
=1709285036706 HTTP/1.1" 200 -
[E 240301 17:25:13 apis:210] get cpu failed
[E 240301 17:25:13 apis:211] 404 Client Error: Not Found for url: https://tool.appetizer.io/JinjunHan/iOSDeviceSupport/raw/master/DeviceSupport/16.6.zip
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 483, in start_service
return self._unsafe_start_service(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 502, in _unsafe_start_service
raise MuxServiceError(error)
tidevice.exceptions.MuxServiceError: InvalidService

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/view/apis.py", line 207, in getCpuRate
    appCpuRate, systemCpuRate = cpu.getCpuRate()
                                ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/apm.py", line 132, in getCpuRate
    appCpuRate, systemCpuRate = self.getAndroidCpuRate(noLog) if self.platform == Platform.Android else self.getiOSCpuRate(noLog)
                                                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/apm.py", line 122, in getiOSCpuRate
    appCpuRate = round(float(apm.getPerformance(apm.cpu)[0]), 2)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/apm.py", line 470, in getPerformance
    perf_value = perf.start(self.pkgName, callback=self.callback)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/_iosPerf.py", line 325, in start
    self._rp = RunningProcess(self._d, bundle_id)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/_iosPerf.py", line 36, in __init__
    self._ins = d.connect_instruments()
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 792, in connect_instruments
    conn = self.start_service(
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 485, in start_service
    self.mount_developer_image()
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 659, in mount_developer_image
    with self._request_developer_image_dir() as _dir: #, signature_path:
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 611, in _request_developer_image_dir
    image_zip_path = cache_developer_image(version)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_imagemounter.py", line 87, in cache_developer_image
    raise err
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_imagemounter.py", line 75, in cache_developer_image
    _urlretrieve(url, image_zip_path)
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/retry/api.py", line 73, in retry_decorator
    return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/retry/api.py", line 33, in __retry_internal
    return f()
           ^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_imagemounter.py", line 30, in _urlretrieve
    r.raise_for_status()
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://tool.appetizer.io/JinjunHan/iOSDeviceSupport/raw/master/DeviceSupport/16.6.zip

127.0.0.1 - - [01/Mar/2024 17:25:13] "GET /apm/cpu?model=normal&platform=iOS&pkgname=com.baozun.xpos&device=00008101-000D318A1400801E&process=&_=1709285036707 HTTP/1.1" 200 -
[E 240301 17:25:13 apis:333] get network data failed
[E 240301 17:25:13 apis:334] 404 Client Error: Not Found for url: https://tool.appetizer.io/JinjunHan/iOSDeviceSupport/raw/master/DeviceSupport/16.6.zip
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 483, in start_service
return self._unsafe_start_service(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/tidevice/_device.py", line 502, in _unsafe_start_service
raise MuxServiceError(error)
tidevice.exceptions.MuxServiceError: InvalidService

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/view/apis.py", line 330, in getNetWorkData
    data = network.getNetWorkData(wifi=wifi,noLog=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/apm.py", line 361, in getNetWorkData
    sendNum, recNum = self.getAndroidNet(wifi) if self.platform == Platform.Android else self.getiOSNet()
                                                                                         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/apm.py", line 354, in getiOSNet
    apm_data = apm.getPerformance(apm.network)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/apm.py", line 464, in getPerformance
    perf.start(self.pkgName, callback=self.callback)
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/iosperf/_perf.py", line 304, in start
    self._rp = RunningProcess(self._d, bundle_id)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/solox/public/iosperf/_perf.py", line 37, in __init__
    self._ins = d.connect_instruments()
                ^^^^^^^^^^^^^^^^^^^^^^^
@rafa0128
Copy link
Member

rafa0128 commented Mar 1, 2024

不支持16.6,最高支持到16.4

@rafa0128
Copy link
Member

rafa0128 commented Mar 1, 2024

可以自己下载对应版本的包放在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
参考:https://github.com/JinjunHan/iOSDeviceSupport

@yinshipeng
Copy link
Author

可以自己下载对应版本的包放在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 参考:https://github.com/JinjunHan/iOSDeviceSupport

目前只能支持到16.7

@rafa0128
Copy link
Member

rafa0128 commented Mar 8, 2024

已经最高了,17苹果官方也不支持这种方式了

@liushijiejob
Copy link

不支持16.6,最高支持到16.4

最低能支持到哪个版本呢? 我的14.7.1 不支持

@rafa0128
Copy link
Member

rafa0128 commented May 13, 2024

看里面有没有你需要的自己下载,有时候支持包会下载失败,把包放到这个路径 ~/.tidevice/device-support/
image

@rafa0128 rafa0128 pinned this issue Aug 22, 2024
@hzm
Copy link

hzm commented Sep 19, 2024

我发现这个问题,是因为tidevie对应获取设备支持的路径不对导致,目前tidevice新版本已经修复了这个问题。例如要下载16.6版本的支持,新的下载路径是类似如下的路径:
https://github.com/JinjunHan/iOSDeviceSupport/raw/master/iOSDeviceSupport/16.6.zip

tidevice修复的两个版本:
alibaba/tidevice@d32ddce#diff-c6aa350e6e6c83c57c4adadee1a1b03ea05f16f255014fb0c0d7d3cff1011d61R49

alibaba/tidevice@b616c36#diff-c6aa350e6e6c83c57c4adadee1a1b03ea05f16f255014fb0c0d7d3cff1011d61

对应tidevice包的_imagemounter.py文件中的def get_developer_image_url_list(version: str) -> typing.List[str]:方法。

可以看看是否有必要更新tidevice的版本,做一些适配。我看FAQ种有说明做过二次开发,只能用solox自带的,所以目前我是手动改了tidevice相应代码的获取地址就正常了。当然手动下载放到对应目录,也能部分解决这个问题。
image

这里只是简单修改,也可以按照tidevice官方最后提交的代码修改_imagemounter.py相应方法。
@rafa0128 作者有空可以留意一下,谢谢。

FAQ中的相应说明:
检查tidevice的版本,不能自己安装最新版本,只能用solox自带的,因为部分代码二次开发过。

@rafa0128
Copy link
Member

我发现这个问题,是因为tidevie对应获取设备支持的路径不对导致,目前tidevice新版本已经修复了这个问题。例如要下载16.6版本的支持,新的下载路径是类似如下的路径: https://github.com/JinjunHan/iOSDeviceSupport/raw/master/iOSDeviceSupport/16.6.zip

tidevice修复的两个版本: alibaba/tidevice@d32ddce#diff-c6aa350e6e6c83c57c4adadee1a1b03ea05f16f255014fb0c0d7d3cff1011d61R49

alibaba/tidevice@b616c36#diff-c6aa350e6e6c83c57c4adadee1a1b03ea05f16f255014fb0c0d7d3cff1011d61

对应tidevice包的_imagemounter.py文件中的def get_developer_image_url_list(version: str) -> typing.List[str]:方法。

可以看看是否有必要更新tidevice的版本,做一些适配。我看FAQ种有说明做过二次开发,只能用solox自带的,所以目前我是手动改了tidevice相应代码的获取地址就正常了。当然手动下载放到对应目录,也能部分解决这个问题。 image

这里只是简单修改,也可以按照tidevice官方最后提交的代码修改_imagemounter.py相应方法。 @rafa0128 作者有空可以留意一下,谢谢。

FAQ中的相应说明: 检查tidevice的版本,不能自己安装最新版本,只能用solox自带的,因为部分代码二次开发过。

我找时间试试

@shinjeiijp
Copy link

参考

可以自己下载对应版本的包放在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 参考:https://github.com/JinjunHan/iOSDeviceSupport

参考这个好用了!
16.7.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants