Run Android Apps over WiFi

Introduction

     I have faced lots of risk in executing my test scripts without USB cable. Finally I got a solution to run/debug my scripts in Android devices over WiFi. The concept has already there in Android SDK with help of adb. Now, I can run my test scripts in multiple Android devices without cable. I hope this tip will helpful to everyone.

Different methods to run application over WiFi

Method 1:

  • Activate debug mode in android
  • Connect to pc via usb
  • Open command prompt type: adb tcpip 5555
  • Disconnect your tablet or smartphone from pc
  • Open command prompt type: ‘adb connect <IPADDRESS>’ (IPADDRESS is the DHCP/IP address of your tablet or smartphone, which you can find by Wi-Fi -> current connected network)
  • Check for list of devices by using ‘adb devices’

Method 2:

  • Activate debug mode in android
  • Connect to pc via usb
  • Open command prompt type: adb connect <IPADDRESS>:<port>
  • Disconnect your tablet or smartphone from pc.
  • Check for list of devices by using ‘adb devices’.

NOTE:

  • We can connect multiple devices over WiFi using ‘adb connect’
  • In this situation, you can capture the screenshot as well as device logs using following commands:
    • Screenshot: > adb shell screencap -p /sdcard/screencap.png
    • Device Log: > adb logcat [filter]