Forwards a remote iOS device, exposed via usbmuxd on Linux to a local macOS client.
The inverse (aka ssh -R) is left as an excercise to the reader, but shouldn't be too hard :)
This is basically a simple usbfluxd that only depends on socat.
Copy the bash script to a local file, say fwd_ios.sh
and make it executable with chmod +x fwd_ios.sh
.
Then, run it and specify the remote host that has the physical iOS device you want connected. Example:
leons-Mac:~ root# ./fwd_ios.sh leon@172.16.182.172
[+] moving real usbmuxd socket out of the way
[+] configuring ssh tunnel to leon@172.16.182.172
leon@172.16.182.172's password:
[+] ssh tunnel PID is 914
[+] connecting remote socket to local socket. ^C to quit and revert
To end the session, hit ^C.
^C[+] killing ssh tunnel with PID 914
[+] restoring real usbmuxd socket
[+] removing dangling remote socket