Closed marvin-kolja closed 3 weeks ago
You code does a lot of stuff and probably at least half of it is redundant Please edit the issue to contain only your issue
Sorry! I just copy pasted what I had in the moment. I removed all the unnecessary code :)
You are using it wrong. The CoreDeviceTunnelProxy
is used to establish VPN connection to the device - nothing more. That is why that's a seperate process. Only from the retrieved connection detials you can connect to the device.
Read further in the project's documentation: https://github.com/doronz88/pymobiledevice3/blob/master/misc/understanding_idevice_protocol_layers.md#remotexpc
~I'm a little bit confused. I don't understand why this needs to be in a separate process as async with service.start_tcp_tunnel() as tunnel:
would give me the connection details.~
I never worked with asyncio. But I assume that the reason for this is that the VPN connection is a blocking operation, thus it prevents the event loop to process other tasks?
Only RemoteXPC has been refactored in pymobiledevice3 v4.0 to be pure asyncio. All usbmux-lockdown remains sync - meaning you'll probably have a deadlock while trying to connect to RSD since you're blocked on connect (sync) while the server cannot accept your connection (async).
Probably only a future major version bump will need to refactor all usbmux-lockdown to be asyncio also. Till then, you'll have to use threads/processes.
I advise on processes since the tunnel creation requires the root user.
Test environment
Describe the bug I'm able to use the cli commands to e.g. get the applist on device:
sudo pymobiledevice3 lockdown start-tunnel
pymobiledevice3 developer dvt applist --rsd <host> <port>
However this doesn't seem to work in python code:
To Reproduce Steps to reproduce the behavior:
Connected to RSD service.
Expected behavior Connect to the rsd service thus I can use it in the
DvtSecureSocketProxyService
Logs
Additional context I've seen that you wrote that when using iOS >= 17.4 we can use usbmux https://github.com/doronz88/pymobiledevice3/issues/975#issuecomment-2094887843. This doesn't work in my case. If I pass the
device
directly to theDvtSecureSocketProxyService
without creating a tunnel first it throws the same error as in #975.For community
⬇️ Please click the 👍 reaction instead of leaving a
+1
or 👍 comment