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

feat: support start-tunnel over Wi-Fi #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

2088669827
Copy link

No description provided.

@codeskyblue
Copy link
Owner

为什么要支持WiFi呀,也特定没支持的,因为觉得这个wifi又慢又不稳定

@2088669827
Copy link
Author

没办法,我们有这个需求

"""return list of udid"""
try:
devices = list_devices(usb=True, network=False)
usb_devices = list_devices(usb=True, network=False)
devices = ["usb_" + d.Identifier for d in usb_devices if Version(d.ProductVersion) >= Version("17")]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里感觉不太好,udid加上前缀 usb_, wifi_ 感觉不如直接定义一个新的类型,比如

get_connected_devices(usb: bool, network: bool) -> List[DeviceInfo]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以提交新版本

start_tunnel_cmd = "lockdown"
cmdargs = pmd3_path + f"{start_tunnel_cmd} start-tunnel --script-mode --udid {udid}".split()
lockdown_devices = get_need_lockdown_devices()
if device_type == "wifi" and _udid not in lockdown_devices:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=17.0 < 17.4 的设备不包含这这里面?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17.4以下,Wi-Fi模式,用remote加-t wifi;17.4以上,Wi-Fi模式和USB模式都用lockdown,没有-t wifi选项

Copy link

codecov bot commented May 28, 2024

Codecov Report

Attention: Patch coverage is 26.08696% with 34 lines in your changes missing coverage. Please review.

Project coverage is 55.58%. Comparing base (c90ab46) to head (6a109b1).
Report is 1 commits behind head on master.

Files Patch % Lines
tidevice3/cli/tunneld.py 26.66% 33 Missing ⚠️
tidevice3/api.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
- Coverage   56.42%   55.58%   -0.85%     
==========================================
  Files          18       18              
  Lines         911      905       -6     
  Branches      101      106       +5     
==========================================
- Hits          514      503      -11     
- Misses        393      398       +5     
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lingling-fa
Copy link

请教下大佬如何使用wifi连接呢,pymobiledevice3的文档有点看不懂,目前

  1. 我只知道 bonjour mobdev2,但是这个要处于同个路由器下才可以
  2. create_using_tcp建立的tcp链接,好像又啥操作都做不了,不知道是我使用方式是不是有问题
    大佬可以指点下吗

@2088669827
Copy link
Author

2088669827 commented Jun 6, 2024

请教下大佬如何使用wifi连接呢,pymobiledevice3的文档有点看不懂,目前

  1. 我只知道 bonjour mobdev2,但是这个要处于同个路由器下才可以
  2. create_using_tcp建立的tcp链接,好像又啥操作都做不了,不知道是我使用方式是不是有问题
    大佬可以指点下吗

首先确保设备通过Wi-Fi连接好了,t3 list -n可以看到设备。
然后pymobiledevice3 remote start-tunnel -t wifi,出现--rsd结果就行了,或者pymobiledevice3 remote tunneld也可以

@2088669827 2088669827 closed this Jun 6, 2024
@2088669827 2088669827 reopened this Jun 6, 2024
@2088669827 2088669827 requested a review from codeskyblue June 20, 2024 11:17
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.

3 participants