pymobiledevice3
pymobiledevice3 copied to clipboard
ConnectionAbortedError when use other commands with lockdown after instal *.ipa via WiFi
Test environment
- Windows 10 Pro 22H2
- iPhone 14 Pro 16.7.2
Describe the bug
ConnectionAbortedError when use other commands with lockdown after instal *.ipa InstallationProxyService when connected via WiFi
For example when i try to get installed apps after install my ipa
But when i check via cli pymobiledevice3 usbmux list, device still connected, and i can run app with cli even on Wifi
To Reproduce
- Connect iPhone to PC with USB
- Unplug cable
- Check device connected with
pymobiledevice3 usbmux list, "ConnectionType": "Network" - Run script (but i cant provide my *.ipa :) )
Expected behavior Error doesn't apears on other commands after install via WiFi
Logs
Traceback (most recent call last):
File "C:\TestData\ios_test_run_snippet.py", line 37, in <module>
app_install(ipa_path, bundle_id)
File "C:\TestData\ios_test_run_snippet.py", line 20, in app_install
if not is_app_installed(bundle_id):
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\TestData\ios_test_run_snippet.py", line 27, in is_app_installed
apps = InstallationProxyService(lockdown=lockdown).get_apps(bundle_identifiers=[bundle_id])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pymobiledevice3\services\installation_proxy.py", line 40, in __init__
super().__init__(lockdown, self.SERVICE_NAME)
File "C:\Python312\Lib\site-packages\pymobiledevice3\services\lockdown_service.py", line 20, in __init__
service = start_service(service_name, include_escrow_bag=include_escrow_bag)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pymobiledevice3\lockdown.py", line 60, in _inner_reconnect_on_remote_close
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pymobiledevice3\lockdown.py", line 487, in start_lockdown_service
attr = self.get_service_connection_attributes(name, include_escrow_bag=include_escrow_bag)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pymobiledevice3\lockdown.py", line 477, in get_service_connection_attributes
response = self._request('StartService', options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pymobiledevice3\lockdown.py", line 546, in _request
response = self.service.send_recv_plist(message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pymobiledevice3\service_connection.py", line 125, in send_recv_plist
return self.recv_plist(endianity=endianity)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pymobiledevice3\service_connection.py", line 164, in recv_plist
return parse_plist(self.recv_prefixed(endianity=endianity))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pymobiledevice3\service_connection.py", line 138, in recv_prefixed
size = self.recvall(4)
^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pymobiledevice3\service_connection.py", line 132, in recvall
raise ConnectionAbortedError()
ConnectionAbortedError
Process finished with exit code 1
Additional context It's works perfect when i connected with USB cable I'll provide py script snippet at comments
P.S. You did grate work, this library is ver helpful!
Py script
from pymobiledevice3.lockdown import create_using_usbmux
from pymobiledevice3.services.dvt.dvt_secure_socket_proxy import DvtSecureSocketProxyService
from pymobiledevice3.services.dvt.instruments.process_control import ProcessControl
from pymobiledevice3.services.installation_proxy import InstallationProxyService
def dvt_launch_app(bundle_id: str, arguments: list = None, kill_existing: bool = True, suspended: bool = False, environment: dict = None):
with DvtSecureSocketProxyService(lockdown=lockdown) as dvt:
process_control = ProcessControl(dvt)
pid = process_control.launch(bundle_id=bundle_id, arguments=arguments,
kill_existing=kill_existing, start_suspended=suspended,
environment=environment)
print(f'Process launched with pid {pid}')
return pid
def app_install(ipa_or_app_path: str, bundle_id: str):
print(f'Start install from {ipa_or_app_path}')
InstallationProxyService(lockdown=lockdown).install(ipa_or_app_path)
if not is_app_installed(bundle_id):
print(f'Install failed')
exit(1)
print(f'Install finished')
def is_app_installed(bundle_id: str):
apps = InstallationProxyService(lockdown=lockdown).get_apps(bundle_identifiers=[bundle_id])
print(f'Installed apps: {apps}')
return len(apps) > 0
bundle_id = "my.unity.game.test"
ipa_path = "C:\\Users\\User\\Downloads\\MyUnityGameTestBuild.ipa"
lockdown = create_using_usbmux(identifier="myiphone14proudid")
app_install(ipa_path, bundle_id)
You also created #932 So does #932 only occurs on specific devices?
I only tested on two devices) but yeah, 932 looks like occurs only on iPhone 8 I'll also try iPhone 11 tomorrow