Native Mobile Bits
Published in

Native Mobile Bits

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,

debugging

Now we have two ways we can do this :

  1. 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).
  2. 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 :)

--

--

--

We share our learnings and experiences in Android & iOS in easy way. We are native development language lovers 🥰 be it KOTLIN or SWIFT. We are going to share some useful coding techniques on both Android + iOS using pure native language

Recommended from Medium

Now in Android: Episode#3

Screen response time. A critical metric for user experience

How to Simplify your Android View Binding Delegation

Jetpack Benchmark on Firebase Test Lab

Changing Package name(Android)/bundle identifier(iOS) in Flutter

Graphs in Android Apps

Screen shot of the charts from my App.

My First Contact With Navigation in Jetpack Compose

Architecture in Jetpack Compose — MVP, MVVM, & MVI

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sachin Rajput

Sachin Rajput

Works on Android at Biofourmis (“Coder for profession😎 || love explaining things in a simple way”) Follow on Native Mobile Bits YouTube

More from Medium

Some Best Practices for Android App Architecture

Wireless Debugging — Android Apps

Explaining SOLID principles with examples of Android programming

Introduction to push on Android