Skip to content

enhance(main/usbmuxd): Add helper script to imitate persistent daemon#29146

Closed
alexytomi wants to merge 2 commits into
termux:masterfrom
alexytomi:usbmuxd-helper
Closed

enhance(main/usbmuxd): Add helper script to imitate persistent daemon#29146
alexytomi wants to merge 2 commits into
termux:masterfrom
alexytomi:usbmuxd-helper

Conversation

@alexytomi
Copy link
Copy Markdown
Contributor

Changes

  • Adds a wrapper script to help users with using usbmuxd
  • Updates usbmuxd dependencies to be in line with actual dependencies

Why

Users have to figure out how to use the janky workaround of manually using termux-usb. This script stops that madness and tries to imitate how it work on desktop, while running it will try to connect to an Apple device using the termux-usb workaround and maintain that connection.

Downsides

Sadly this doesn't really do the daemon part of usbmuxd as there's no way to get a notification if a USB device was plugged, that means we would have to continuously poll Termux:API if we wanted this to run as a service/daemon type of thing which causes issues on some ROMs that don't like spamming termux-usb commands although if that is preferred I would be happy to rewrite everything as a runit service that just polls.

Note: By iDevice, this means iPhones, iPads, iPods, Airpods, etc. Apple
Products if you will.

This script restarts usbmuxd to refresh the fd provided by `termux-usb`
when iDevice is disconnected, imitating how it normally behaves on
traditional desktop linux.

This is intended to be ran by any program that will use usbmuxd.

We cannot have multiple iDevices connected due to `termux-usb`
limitations so the best we can do is warn the user about it.

If there are multiple USB devices connected, the script will cycle each
one of them and ask the user for permission before verifying whether the
device is an iDevice.
…`libimobiledevice`

This is the correct dependency to actually run `usbmuxd`, even moreso
for the helper script
@alexytomi
Copy link
Copy Markdown
Contributor Author

This is a very janky workaround. What would be better is to wait for termux/termux-api-package#204 and patch usbmuxd to use that instead.

@alexytomi alexytomi closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant