Android : How to connect your Android device over Wifi using ADB command for App debugging

How to connect your Android device over Wi-Fi using ADB command


Sometimes it requires to connect your Android device over Wi-Fi using ADB command to get rid of USB cable. Also, if you want to run automation and you want to keep your mobile to a place where is it safe or locked, in such cases you won’t be able use USB cable all the time connected to your pc or laptop. The USB cable sometime limits your movements as well.
These above reasons are my experiences which I faced while working on Android App automation.

Let see how to overcome this issue with available ADB commands. Below are the procedures to connect Android Device over Wi-Fi using ADB Command.

Important: Make sure your PC/Laptop and Mobile phone are connected to same Wi-Fi network.


Pre-requisites:
1.    Make sure you have Android_Home configured into your PC/laptop - (click here to see how to configure)
2.    You must have USB debugging option enabled into your Mobile phone.
3.    Connect your Android Device using USB cable to your pc/laptop

You can watch Youtube video or follow the steps mentioned below






Now run below adb commands. 

4. To check list of devices connected & to ensure your USB debugging option is working fine.  
       -> adb devices
how to connect android device over wifi


5.    Run adb tcpip 5001
(you can choose any random port)

how to connect android device over wifi - adb tcpip

 6.  Disconnect your device (remove the USB cable).
7.  Go to the Settings -> About phone -> Status to view the IP address of your phone.



8. Run adb connect <IP address of your device>:5001

how to connect android device over wifi - adb connect 192.168.1.2


9. If you run adb devices again, you should see your device.




Now you can execute adb commands or use your IDE for android development/debugging - wireless

10. If you want to see IP address of your phone , run
 ->  adb shell ifconfig | grep inet

Or
To see list of Apps installed i.e packages onto your phone
 -> adb shell pm list packages

Hope you like this post. if you have any question ,please comment down below.
You can subscribe to my Youtube channel @ QAHUMOR
Thank you year 2017 :-)

No comments:

Post a Comment

Android : How to connect your Android device over Wifi using ADB command for App debugging

How to connect your Android device over Wi-Fi using ADB command Sometimes it requires to connect your Android dev...