Troubleshooting Attaching To iOS Devices¶
Problem¶
You want to do iOS device testing and you already did all the necessary modifications described in the documentation. But when you try to attach to the application, it does not work.
Basic Requirements¶
Testing an iOS app with Squish on the device has the following requirements:
- The device must not be locked.
- The device must not be in sleep mode.
- The app you want to test has to be running in the foreground on the device.
Verify That Squish's Built-In Hook Is Active In The AUT¶
When modifying the app for Squish testing you might have missed a step. If your modifications were successful, you should see the message
Listening on port <number> for incoming connections
during app startup. If you don't see it, you missed at least one of the necessary steps and you need to check them again. Make sure that you rebuilt your app in the proper build configuration.
Verify Network Connectivity Between iOS Device and Computer¶
There must be a working network connection between the iOS device and the computer running Squish.
- Both devices need to be able to connect to each other, e.g. from the device to the computer and vice versa. A normal Wifi network typically works fine. Testing over the Internet with the device in a 3G network will not work (because of carrier-grade NAT).
- Make sure that the firewall on the desktop computer does not block connections from the device. To rule out firewall problems, disable the firewall altogether for a quick test (please remember to enable it again after the experiment).
Verify That The Computer Can Connect To The AUT (Built-In Hook)¶
If you checked all of the above and Squish is still not working, please open Terminal.app on your Mac (located in /Applications/Utilities
) and execute the netcat
utility as follows:
nc <device IP or hostname> <port>`
Make sure to replace <device IP>
with the IP address of the device and <port>
with the port number that is part of the "Listeing on port ..." message.
You may see different results:
An error message about the connection to the IP address being refused. Possible reasons (see the above points for resolutions of the problems):
- You used the wrong IP address or the wrong port number.
- The application (AUT) is not running on the device.
- The modifications to the application were not sufficient.
Another error message. This means that there seems to be some other network problem so the computer cannot connect to the device. Please act upon the exact error message the
telnet
command gives you.You see just one message:
go
This means that you are almost there (i.e. the modifications to the application were correct and that desktop computer can connect to the device). The problem is that the device fails to connect to the computer, possibly because of a firewall on the computer.
Note: Please make sure to force quit the app on the device (via the iOS task manager) in case you tried the
telnet
command and saw thego
message!