April 18, 2017

Learning Appium Desktop: Setting up remote devices through WiFi

This is Part 3 of 6. Care to go back to the beginning? Tune in tomorrow to see the next part!

Yesterday, we talked all about connecting Android devices to your computer through a USB cable. What we didn’t cover was that you can also do this through WiFi!

Why is this important?

Imagine that you are an automation developer who wants to test on real devices. Instead of being forced to have each and every device attached to your computer with a tangle of USB cables, you can have all devices locked down in a lab.

With an automation test you can:
  • Install an Android app on a remote device.
  • Start up the Android app
  • Run your test.
  • Uninstall the app.

… All while connected to the WiFi!



How to do this? From Android Developer: ADB: https://developer.android.com/studio/command-line/adb.html#wireless


Step 1
: Connect your Android device and adb host computer to a common Wi-Fi network accessible to both.


Step 2: Connect the device to the host computer with a USB cable.


Step 3:  Set the target device to listen for a TCP/IP connection on port 5555.

adb tcpip 5555


Step 4:  Disconnect the USB cable from the target device.

Step 5: Find the IP address of the Android device. For example, on a Nexus device, you can find the IP address at Settings > About tablet (or About phone) > Status > IP address

For example, 172.17.208.126

adb connect device_ip_address


Step 6:  Connect to the device by its IP address.

You will need to press OK when you receive a popup on your device.


Step 7:  Confirm that your host computer is connected to the target device:

$ adb devices

List of devices attached
device_ip_address:5555 device


Example: 

$ adb devices

List of devices attached
172.17.208.126:5555 device

 $ adb devices  
   
 List of devices attached  
 172.17.208.126:5555 device  


Now that we have an actual device attached to our computer, we can test on this device using Appium Desktop!



Happy Testing!

-T.J. Maher
Twitter | LinkedIn | GitHub

// Sr. QA Engineer, Software Engineer in Test, Software Tester since 1996.
// Contributing Writer for TechBeacon.
// "Looking to move away from manual QA? Follow Adventures in Automation on Facebook!"
Post a Comment