iOS automation through USB cable connection

Last edited on

So far, doing S/iOS tests on a device required to have a WiFi connection from the desktop computer to the device and vice-versa.

Since Squish 6.0 it is possible to run tests through a USB cable connection instead of WiFi, with the help of a 3rd party tool.

The 3rd party tool is needed to tunnel or proxy the TCP/IP connection through the USB cable since Apple does not provide a tool for this.

usbmuxd (libimobiledevice, cross-platform)

One tool that supports this is libimobiledevice . It claims to be cross-platform and that it works also on Linux and Windows. (So far we have tested it on OS X only.)

The installation on OS X is simple if you use the package manager homebrew :

brew install usbmuxd

The tool to do the port forwarding is iproxy and can be used like this:

iproxy LOCAL_TCP_PORT DEVICE_TCP_PORT [UDID]

(So if you have just one device attached through USB, you don't need to specify the device's UDID.)

If you use the port number 11233 in the attachable AUT build for the device and you want to forward it to the local port 4711 on you desktop computer, just call

iproxy 4711 11233

Then you can register in Squish an attachable AUT for host localhost and port 4711 and connect to it.

It is also possible to forward the remote port to the same local port, so if you want forward the remote 11233 to the local port 11233 just call

iproxy 11233 11233

and register in Squish the attachable AUT for host localhost and port 11233.

mobiledevice (macOS only)

There are also other tools than the iproxy which do the same: mobiledevice . There, the command for doing the port forwarding looks like:

mobiledevice tunnel -u <UDID of the device> 11233 11233