Debug your Android Apps without Data-Cable.
As an Android developer, Debugging is one of the most common tasks which we do on a daily basis,
Now we have two ways we can do this :
- We can connect our phone with a data cable to our laptop and then we can debug our app installed in the phone (By connecting to the laptop with help of the cable).
- We can also debug our app over wifi, with the help of ADB. (YES I KNOW MOST OF US USE THIS 2nd way and it's just great)
Now most of us are already using these both ways from long back, still, I think it will be helpful for some people (like it helps lots of us in a major way).
This article is mostly on the 2nd way of debugging, so let's start:
(ONLY THING TO NOTE IS PHONE AND LAPTOP SHOULD CONNECT TO SAME WIFI/NETWORK)
Step1: Open a terminal or command prompt based on your laptop OS
Step2: In this step just for once you need to connect your device to your laptop with cable (JUST ONCE)
Step3: If you already have ADB installed you can use the below commands:
adb devices
adb tcpip 5555
adb connect 192.168.20.150:5555 . (adb connect your_device_ip:port)
adb devices
so let's go through these commands one by one.
adb devices
This command will show you the devices/emulator opened(Connected to laptop) at the moment.
adb tcpip 5555
This command will open a port at this given address
Then we need to take our device IP address from our phone(you can find this inside Settings-> About phone.
adb connect your_device_ip:5555
In this above command, we need to paste our device IP address,
for eg.)
adb connect 56.159.82.221:5555
and your device will be connected over wifi with your laptop.
Now if you hit the same command adb devices
to check the availability of devices (before removing the data-cable) you will see two devices
and now we can remove the data cable and we can debug over wifi.
That's what I wanted to share today. In case adb is not there Just Install from here:
Install homebrew-
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Install adb-
brew cask install android-platform-tools
You can also check the same commands process, over here https://github.com/droid-lover/Debug-over-WIFI
If you find it hopeful, Please hit the clap icon.
Thanks, 😊 Keep smiling Keep Coding :)