Skip to content

fix: 适配 iOS 18.2+,升级 pymobiledevice3 至 9.x#96

Open
wxxcl0825 wants to merge 1 commit into
iOSRealRun:mainfrom
wxxcl0825:fix/support-ios-18.2-pymobiledevice3-9
Open

fix: 适配 iOS 18.2+,升级 pymobiledevice3 至 9.x#96
wxxcl0825 wants to merge 1 commit into
iOSRealRun:mainfrom
wxxcl0825:fix/support-ios-18.2-pymobiledevice3-9

Conversation

@wxxcl0825

Copy link
Copy Markdown

背景

当前依赖的 pymobiledevice3 2.46.1 无法连接 iOS 18.2 及以上设备(实测 iOS 26.5.1),启动隧道时报错。原因有两点:

  1. iOS 18.2+ 移除了 QUIC 隧道协议,必须改用 TCP 协议(QuicProtocolNotSupportedError: iOS 18.2+ removed QUIC protocol support)。
  2. pymobiledevice3 9.x 将设备相关 API 全面改为 async,并移除/重命名了项目用到的多个符号(select_deviceinstall_driver_if_requiredDvtSecureSocketProxyServicecreate_amfi_show_override_path_file 等)。

改动

  • requirements.txtpymobiledevice3 2.46.1 → 9.27.0
  • driver/connect.py:lockdown / AMFI 调用改为 async;改用 get_core_device_tunnel_services + start_tunnel(protocol=TunnelProtocol.TCP) 替代已移除的 select_device / install_driver_if_required
  • main.py:使用 RemoteServiceDiscoveryService + DvtProvider + LocationSimulation 重写为 async,由 asyncio.run 驱动
  • driver/location.pyrun.pyinit/init.pyinit/tunnel.py:跟随改为 async
  • run.py:用 asyncio.sleep 取代忙等待循环

说明

  • Python < 3.13 时 TCP 隧道依赖 sslpsk_pmd3 的 PSK-TLS 回退实现(pymobiledevice3 自带依赖)。
  • 已在 iOS 26.5.1 + macOS + Python 3.11 实测可正常模拟跑步。

🤖 Generated with Claude Code

旧版 pymobiledevice3 2.46.1 无法连接 iOS 18.2 及以上设备(如 iOS 26),
原因有二:

1. iOS 18.2+ 移除了 QUIC 隧道协议,必须改用 TCP 协议;
2. pymobiledevice3 9.x 将设备相关 API 全面改为 async,并移动/重命名了
   大量符号(select_device、install_driver_if_required、
   DvtSecureSocketProxyService 等已不存在)。

主要改动:

- requirements.txt: pymobiledevice3 2.46.1 -> 9.27.0
- driver/connect.py: lockdown / AMFI 调用改为 async;用
  get_core_device_tunnel_services + start_tunnel(protocol=TCP) 替代
  已移除的 select_device/install_driver_if_required
- main.py: 用 RemoteServiceDiscoveryService + DvtProvider +
  LocationSimulation 重写为 async(asyncio.run 驱动)
- driver/location.py、run.py、init/init.py、init/tunnel.py: 跟随改为 async
- run.py: 用 asyncio.sleep 取代忙等待循环

注:Python < 3.13 时 TCP 隧道依赖 sslpsk_pmd3 的 PSK-TLS 回退实现。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant