Skip to content

Instantly share code, notes, and snippets.

@redanium
Forked from gabrc52/ideviceforward
Created October 21, 2022 01:25
Show Gist options
  • Save redanium/b259614ed7b8ef1f3087583c347cd7ba to your computer and use it in GitHub Desktop.
Save redanium/b259614ed7b8ef1f3087583c347cd7ba to your computer and use it in GitHub Desktop.
Forward iOS device from host to guest (OSX-KVM)
#!/bin/bash
# Debug
set -o xtrace
GUEST_IP=192.168.122.221
HOST_IP=192.168.122.1
# Wipe the current usbfluxd, usbmuxd, and socat:
sudo killall usbfluxd
sudo systemctl restart usbmuxd
sudo killall socat
# Start usbfluxd and required stuff on host
sudo avahi-daemon -D
sleep 1
sudo systemctl restart usbmuxd
sudo socat tcp-listen:5000,fork unix-connect:/var/run/usbmuxd &
sleep 1
sudo usbfluxd -n
sleep 1
# Start usbfluxd and required stuff on guest
ssh -t $GUEST_IP "sudo launchctl start usbmuxd"
sleep 1
ssh -t $GUEST_IP "sudo /usr/local/sbin/usbfluxd -r $HOST_IP:5000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment