YueChen-C / py-ios-device

IOS Professional Performance Testing Tool . You can get CPU, GPU, Memory , Lifecycle and other metrics from real iOS devices . iOS 性能测试工具
GNU General Public License v3.0
686 stars 188 forks source link

The CLI fails to start when Python 3.12 is used #146

Closed mykola-mokhnach closed 5 months ago

mykola-mokhnach commented 5 months ago

OS: macOS 14.5 Python version 3.12 Module version: 2.4.13, installed via pipx

Getting the following exception in the terminal:

% pyidevice --version
Traceback (most recent call last):
  File "/Users/elf/.local/bin/pyidevice", line 5, in <module>
    from ios_device.main import cli
  File "/Users/elf/.local/pipx/venvs/py-ios-device/lib/python3.12/site-packages/ios_device/main.py", line 2, in <module>
    from ios_device.cli.instruments import cli as instruments_cli
  File "/Users/elf/.local/pipx/venvs/py-ios-device/lib/python3.12/site-packages/ios_device/cli/instruments.py", line 8, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

The reason for the above is that the distutils module has been deprecated for quite long and is removed from Python now. It is necessary to replace its usage with an alternative solution.

YueChen-C commented 5 months ago

@mykola-mokhnach Modified on version 2.4.14

mykola-mokhnach commented 5 months ago

Thanks for fixing it so fast. The CLI tool could be executed properly now with the latest python version.