-
Notifications
You must be signed in to change notification settings - Fork 23
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
pymobiledevice3 包中的 install_driver_if_required 函数无法被找到 #70
Comments
尝试使用python3.9,高版本与包依赖存在冲突,我本机py3.13出现了同样报错 |
我遇到了同样的问题,原因是 pymobiledevice3 删去了 driver 的下载,而且有些函数名(或者所在位置)改变了,你需要这样更改: import logging
import multiprocessing
from pymobiledevice3.lockdown import create_using_usbmux, LockdownClient
# from pymobiledevice3.cli.remote import install_driver_if_required
# from pymobiledevice3 import usbmux
from pymobiledevice3.cli.remote import get_device_list
from pymobiledevice3.cli.remote import RemoteServiceDiscoveryService
from pymobiledevice3.remote.core_device_tunnel_service import start_quic_tunnel
from pymobiledevice3.cli.remote import verify_tunnel_imports
from pymobiledevice3.services.amfi import AmfiService
from pymobiledevice3.exceptions import NoDeviceConnectedError 然后修改下面的函数: def get_serverrsd():
# install_driver_if_required()
if not verify_tunnel_imports():
exit(1)
return get_device_list()
async def tunnel(rsd: RemoteServiceDiscoveryService, queue: multiprocessing.Queue):
async with start_quic_tunnel(rsd, None) as tunnel_result:
queue.put((tunnel_result.address, tunnel_result.port))
await tunnel_result.client.wait_closed() driver/tunnel.py def tunnel_proc(queue: multiprocessing.Queue):
server_rsd_list = connect.get_serverrsd()
server_rsd = server_rsd_list[0]
asyncio.run(connect.tunnel(server_rsd, queue)) driver/location.py def set_location(dvt, lat: float, lng: float):
LocationSimulation(dvt).simulate_location(lat, lng)
def clear_location(dvt):
LocationSimulation(dvt).stop() 现在我的 iosrealrun 可以工作了(给我好好地去线下打卡x)。 希望对你有所帮助:D |
另外我的 python 版本是 3.9.20,pymobiledevice3 版本调成 2.20.0 改的,其他版本的可以自己试试,方法大差不差的。 |
你好在运行main.py的时候出现如下报错:
(fakerun) ...@macbook-pro iOSRealRun-cli-17 % sudo python3 main.py
/Users/.../ZJU/fakerun/lib/python3.9/site-packages/urllib3/init.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: urllib3/urllib3#3020
warnings.warn(
Traceback (most recent call last):
File "/Users/.../ZJU/iOSRealRun-cli-17/main.py", line 11, in
from init import init
File "/Users/.../ZJU/iOSRealRun-cli-17/init/init.py", line 5, in
from driver import connect
File "/Users/.../ZJU/iOSRealRun-cli-17/driver/connect.py", line 6, in
from pymobiledevice3.cli.remote import install_driver_if_required
ImportError: cannot import name 'install_driver_if_required' from 'pymobiledevice3.cli.remote' (/Users/.../ZJU/fakerun/lib/python3.9/site-packages/pymobiledevice3/cli/remote.py)
The text was updated successfully, but these errors were encountered: