Connect Android device wirelessly (over Wi-Fi) to your machine

When you want to run tests on android devices, you have to connect your phone(s) to your test running machine. Adding and removing different devices to your machine is a bit of a headache and it looks messy as well. So if you want to connect your android device to your machine over Wi-Fi (wirelessly) you can do the following.

 

    1. First connect your device to your test machine
    2. From the command prompt/terminal, run the command

adb devices

        (you should see the connected device to your machine)

    1. Make sure that your device and your test machine are in the same network.
    2. Run the command

adb tcpip 5555

    1. You will see a message saying “restarting in TCP mode port: 5555”
    2. Disconnect the device from your machine
    3. Get the IP address of your phone (Go to Settings > Wi-Fi > Your Connected Network > IP Address)
    4. You may have to long tap your network name to see the IP Address, depending on your android version
    5. Run the following command to connect adb to your device over Wi-Fi using the given IP Address

adb connect <your phone’s IP address>

    1. Your devices should now be connected
    2. You can verify the same by running the command

adb devices

  1. Now you have connected your device wirelessly to your machine. You can run your Appium tests wirelessly.

 

Leave a Reply

Your email address will not be published. Required fields are marked *