Highlights
⚠️ The AFC and crash-report shells no longer run on xonsh
afc shell, apps afc and crash shell are now built on a small prompt_toolkit shell that ships with pymobiledevice3, and xonsh is no longer a dependency. What changes at the prompt:
- Python expressions are no longer evaluated at the prompt.
show-helpis nowhelp;help COMMANDshows one command's usage and options.- If your own code relied on
xonshbeing installed alongside pymobiledevice3, install it yourself.
The service API is unchanged, and AfcShell.create(...) keeps its signature. The shell classes themselves (AfcShell, CrashReportsShell) were rewritten, so code that subclassed them or called their internals needs updating.
✨ Pipes, redirection and host tools in the device shells
Device commands can be piped into host tools and redirected to local files, and chained with &&, || and ;. A common set of host tools (grep, sed, awk, sort, uniq, cut, tr, tail, wc, less, ...) is available by name, --tool NAME adds more, and !TOOL runs any other host program.
pymobiledevice3 afc shell --tool jq
# /> walk DCIM | grep -c HEIC
# /> cat Downloads/notes.txt | sort | uniq > notes.txt
# /> cat config.json | jq .version
# /> help pullRemote paths complete with Tab, cat is byte-exact so binary files survive a redirect, and Ctrl-C cancels the running command without leaving the shell.
🐛 universal-hid-service type keeps uppercase and shifted characters
Shift arrived in the same report as the key it modified, and the device could ignore it, so abc ABC was typed as abc abc. Shift is now sent in a report of its own first. The first keys sent after the virtual keyboard was created could also be read with Shift stuck on; creating the keyboard now waits for it to attach, which covers type, serve-web and serve-vnc.
pymobiledevice3 developer core-device universal-hid-service type 'abc ABC'🐛 serve-web shuts down cleanly
Stopping the viewer cancelled tasks it did not own and could leave browser connections open while the device-side stream was being torn down. It now cancels only its own tasks, and closes its connection handlers before the device-side teardown.
What's Changed
- 5bbedb6 core_device: Wait for the keyboard to attach in create_keyboard_service (#2029) (@doronz88)
- b4293db serve-web: Stop connection handlers before the device-side teardown (#2027) (@doronz88)
- 34152b9 core_device: Let the virtual keyboard attach before
typesends keys (#2029) (@NikitaMGrimm) - e53cd00 docs: Describe pipes, redirection and host tools in the AFC shell recipe (#2028) (@doronz88)
- 7ec185b afc: Build the AFC shell on interactive_shell instead of xonsh (#2028) (@doronz88)
- 18c2fbc interactive_shell: Add a prompt_toolkit-based command shell (#2028) (@doronz88)
- a1b5a28 serve-web: Cancel only the viewer's own tasks at shutdown (#2027) (@NikitaMGrimm)
- a2bc439 core_device: Establish Shift before typing shifted keys (#2026) (@NikitaMGrimm)
New Contributors
- @NikitaMGrimm made their first contribution in #2026
Full Changelog: v11.28.2...v11.29.0