pymobiledevice3
pymobiledevice3 copied to clipboard
AttributeError('__enter__') error when trying to use rsd address
Test environment
- macOS Sonoma 14.4.1
- iPhone XS iOS 17.5
- pymobiledevice3 v4.5.3
Describe the bug Getting AttributeError('enter') error when trying to use rsd address
Issue
Since asyncio refactor that cames with the wifi feature I'm getting AttributeError('enter') when trying to use rds address and dvt instance. While debugging: the name, peer_info, lock_down and all_values RemoteServiceDiscoveryService's attributes are somehow empty.
I can't figure out what could be happening here, this is a piece of code I had working until now where you can hopefully reproduce this.
def connection_context(self, callback):
try:
if Version(self.device_info.device_version) >= Version('17.0'):
available_address = tunnel_creator.get_available_address() # {'address': 'fd6d:9665:5e8e::1', 'available': False, 'port': 64531}
if available_address:
with RemoteServiceDiscoveryService((available_address["address"], available_address["port"])) as rsd:
with DvtSecureSocketProxyService(rsd) as dvt:
callback(dvt)
else:
raise Exception("An error occurred getting tunnels addresses...")
else:
# Use USB Mux
lockdown = self.get_lockdown()
with DvtSecureSocketProxyService(lockdown=lockdown) as dvt:
callback(dvt)
except OSError: # no route to host (Intel fix)
pass
except DeviceLockedError:
raise
except Exception as e:
raise Exception(f"Connection not established... {e}")
That's because v4.0.0 changed the RSD API to be asyncio. See the release notes: https://github.com/doronz88/pymobiledevice3/releases/tag/v4.0.0
That's because v4.0.0 changed the RSD API to be asyncio. See the release notes: https://github.com/doronz88/pymobiledevice3/releases/tag/v4.0.0
Can I ask why is almost the entire project async now?
So tunneld won't get stuck when starting different tunnels simultaneously