How do I test on Android device over WiFi

Last edited on

If you want to test a native Android app on real hardware over WiFi there is an easy mechanism in Android to allow you to pair your device to the machine driving the test.

For this the device you run Squish on and the Android device will need to be on the same network, and you will need developer rights on your device.

Developer permissions are usually acquired by repeatedly tapping on the build number in the device information. After a few taps you should see a toast message from Android telling you how many you still need to perform until you are a developer on this device.

Once you have developer permissions, go to the developer options located in the 'System' settings and enable 'Wireless Debugging'.

Enable the setting and accept the debugging on the network you are on. Once you have done that, tap on the 'Wireless Debugging' again to get to the pairing information.

Tap on the entry 'Pair device with six digit code'. This will open a new dialog that shows the six digit code needed for the pairing process.

On your local machine, open a terminal and navigate to the bin folder of your Squish for Android installation. Then execute the following command:

    ./adb pair DEVICE_IP:PORT PAIRING_CODE

In this, replace 'DEVICE_IP', 'PORT', 'PAIRING_CODE' accordingly.

If the pairing was successful adb will output a message that confirms this, and your user name plus hostname will show up in the paired devices on your Android device.

If you have the Squish for Android IDE open at the time of pairing, you will likely need to restart it for the device to be picked up by it.