• Skip to main content
  • Skip to primary sidebar

AutomationTestingHub

Selenium, Appium, Cucumber and more !!!

Run Appium Tests over WiFi on Real Devices

March 2, 2017 by anish 1 Comment

Imagine a situation when you want to run your Appium tests on a real device, but you forgot to bring the USB cable. You maybe be able to borrow a USB cable from a colleague for sometime, but maybe not for the entire day where you would be using the mobile device for scripting or execution. Or consider a scenario you want to execute your test scripts in parallel on multiple devices, but you don’t have enough USB ports on your machine? Wouldn’t it be great if there was some other method to connect your mobile devices to your machine without USB cables? Well, the good news is that there is an easy way to do this. Instead of using USB cables, you can connect your mobile devices to your machine in wireless mode and then run Appium Tests over WiFi.

Run appium tests over WiFi

The process is pretty straightforward. There is not much code change that you have to do anywhere. All you have to do is use ADB to connect the device via WiFi instead of USB. After that you can run your test scripts exactly the same way you do it when the mobile device is connected via USB. Let us now see the steps that you can follow to connect your mobile devices to your machine over WiFi.

Steps to connect mobile devices over WiFi

1. First of all, connect your mobile phone to your machine via USB cable

2. Open command prompt and run the command: adb devices

3. This would list down the mobile devices that are currently connected to your machine, as shown in the below image

Mobile device connected to machine using USB

In the above image, note that when the device is connected via USB, then the actual device id is displayed in the command prompt.

4. Now, run this command: adb tcpip 5555. Please note that the number 5555 is just a random port number. You can use any port number as you wish. Also, please make sure that your mobile device and system are connected to the same WiFi network.

adb tcpip 5555

Once you run this command, you will see the message – restarting in TCP mode port: 5555, as shown in the above image.

5. Now, disconnect your mobile device from your machine. You will not need your USB cable any more

6. The next step is to find out the IP address of your mobile device. On your mobile device, go to Settings > WiFi > your connected network > and note down the IP address

Appium tests over WiFi - IP address of mobile device

7. Next, run this command: adb connect in command prompt. You will see a message as – connected to ip address:5555, which means that your mobile device is now connected to the machine.

adb connect ip-address - to connect mobile device to machine

8. The final step is to just verify, or to say be double sure that the mobile device is connected to your machine. To check this, run the command: adb devices once again. This command would show the list of connected devices. Please note that the device name would have changed now. Previously when you ran this command in Step 2 above, you would have seen that the actual device id was displayed. But now, ip address:port is displayed as the connected device.

The below image confirms that the mobile device is connected to the machine through wireless mode.

Run Appium tests over WiFi - adb devices command showing devices connected over WiFi

Now you can run Appium tests over WiFi. The only thing that you have to change in your scripts is the device id. In your scripts, replace the original device id with this ip address:port combination and then run your test scripts. All your scripts should run perfectly fine.

Try this out and see if it works. This would be a handy solution when you need to give a demo about Appium execution to your team. If you are not using any mirroring techniques, you can just pass around the device to other folks while the script is still running. If you face any issues with the connectivity, then please let us know about it using the comments section.

Filed Under: Appium

Primary Sidebar

Automation Testing Hub

Tutorials Guide

Write test scripts in BDD format using our Cucumber Selenium Tutorial

Use our Appium Tutorial Series to setup Appium from scratch

Categories

  • Android
  • Appium
  • Cucumber
  • Java
  • Playwright
  • Selenium
  • Tosca

Recent Posts

  • Appium Inspector – Download and Install
  • How to download Chromedriver for Selenium
  • Run Playwright tests on different browsers
  • Playwright Automation Testing Tutorial
  • Selenium IDE Chrome Download

Recent Comments

  • Run Playwright tests on different browsers - AutomationTestingHub on Playwright Automation Testing Tutorial
  • Confluence: CPSSoft Test Framework on Appium Inspector – Download and Install
  • Playwright Automation Testing Tutorial - AutomationTestingHub on Download and Install – Node.js and NPM
  • Chrome浏览器在使用Java的Appium中无法启动。 | JAVA语言的经验与见解 on 2 Ways to find appPackage and appActivity name of your App
  • Appium Inspector Tutorial - AutomationTestingHub on Download and Install Appium 2 Server

Archives

  • January 2024
  • July 2023
  • March 2023
  • February 2023
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016

Latest Selenium 3 Guide

Are you using the latest version of Selenium WebDriver? It provides lot better support for the latest browser versions. Check it out here - Setup Latest Selenium WebDriver

Categories

  • Android
  • Appium
  • Cucumber
  • Java
  • Playwright
  • Selenium
  • Tosca

Copyright © 2025 · Genesis Sample on Genesis Framework · WordPress · Log in

Go to mobile version