What happened?
pymobiledevice3 developer dvt sysmon system fails when xcuitest is already running on the same device. Two different failure modes:
iOS ≤ 16: The command exits with code 0 and writes nothing to stdout. Only stderr shows "Connection was terminated abruptly". Since exit code is 0, there's no way to programmatically detect the failure.
iOS 17+: The command gets InvalidServiceError, falls back to tunneld, but the fallback works for some devices and fails for others — on the same host, same tunneld process. Failing devices get IncompleteReadError: 0 bytes read on a total of 9 expected bytes
during XPC handshake. rsd-info works fine for all devices.
Expected: sysmon should either coexist with xcuitest, or fail with a non-zero exit code. On iOS 17+, tunneld fallback should work consistently for all connected devices.
How can we reproduce this?
# 1. Start xcuitest on device
pymobiledevice3 developer dvt xcuitest com.facebook.WebDriverAgentRunner.xctrunner --udid <UDID> &
sleep 5
# 2. Run sysmon on the same device
pymobiledevice3 developer dvt sysmon system --udid <UDID>; echo "EXIT_CODE: $?"
# iOS ≤ 16: exits with code 0, stdout empty, stderr shows "Connection was terminated abruptly"
# iOS 17+: works for some devices, fails with IncompleteReadError for others on the same host
Environment
Host OS: Linux (Docker container)
Python: 3.12
pymobiledevice3: latest (pipx)
Background: pymobiledevice3 remote tunneld running
Tested devices:
- iPhone9,3 / iOS 15.8.3 → DTX connection terminated (exit code 0)
- iPhone10,4 / iOS 16.7.10 → DTX connection terminated (exit code 0)
- iPhone10,6 / iOS 16.7.11 → DTX connection terminated (exit code 0)
- iPhone17,5 / iOS 18.6.2 → tunneld fallback SUCCESS
- iPhone15,4 / iOS 18.6.2 → tunneld fallback FAIL (IncompleteReadError)
- iPhone14,7 / iOS 26.0.1 → tunneld fallback FAIL (IncompleteReadError)
All devices: developer mode enabled, DDI mounted, paired
Relevant log output
# iOS ≤ 16 output:
$ pymobiledevice3 developer dvt sysmon system --udid <device>; echo "EXIT_CODE: $?"
INFO DTX reader exiting: connection terminated
ERROR Connection was terminated abruptly
EXIT_CODE: 0
# iOS 17+ failing device output:
$ pymobiledevice3 developer dvt sysmon system --udid <device>
WARNING Got an InvalidServiceError. Trying again over tunneld since it is a developer command
IncompleteReadError: 0 bytes read on a total of 9 expected bytes
# iOS 17+ working device output (same host, same tunneld):
$ pymobiledevice3 developer dvt sysmon system --udid <device>
WARNING Got an InvalidServiceError. Trying again over tunneld since it is a developer command
ERROR Error in channel on_closed handler for channel 2
TypeError: Queue does not support shutdown()
vmFreeCount: 25701
CPU_TotalLoad: 80.53
EnabledCPUs: 6
# ... data returned successfully despite the TypeError
Search
AI assistance
Claude assisted with formatting and structuring this report. The debugging, device testing, and data collection were done manually.
Code of Conduct
Additional context
- pymobiledevice3 remote rsd-info works for all iOS 17+ devices — RSD connectivity is fine, the issue is specific to tunneld's per-device tunnel stability.
- The working iOS 17+ device (iPhone17,5) also shows the TypeError: Queue does not support shutdown() traceback but still returns data. The failing devices crash before reaching that point.
What happened?
pymobiledevice3 developer dvt sysmon system fails when xcuitest is already running on the same device. Two different failure modes:
iOS ≤ 16: The command exits with code 0 and writes nothing to stdout. Only stderr shows "Connection was terminated abruptly". Since exit code is 0, there's no way to programmatically detect the failure.
iOS 17+: The command gets InvalidServiceError, falls back to tunneld, but the fallback works for some devices and fails for others — on the same host, same tunneld process. Failing devices get IncompleteReadError: 0 bytes read on a total of 9 expected bytes
during XPC handshake. rsd-info works fine for all devices.
Expected: sysmon should either coexist with xcuitest, or fail with a non-zero exit code. On iOS 17+, tunneld fallback should work consistently for all connected devices.
How can we reproduce this?
Environment
Host OS: Linux (Docker container)
Python: 3.12
pymobiledevice3: latest (pipx)
Background: pymobiledevice3 remote tunneld running
Tested devices:
All devices: developer mode enabled, DDI mounted, paired
Relevant log output
Search
AI assistance
Claude assisted with formatting and structuring this report. The debugging, device testing, and data collection were done manually.
Code of Conduct
Additional context