Wi-fi-debugging with ADB wireless Connection
You don't need to use USB cable to connect your android device to your computer. You can connect your android device to the computer through wifi also.
Few precautions for oreo and pie devices
For connecting your android device with android oreo or onwards you need to ensure that you connect with your computer using "USB for file transfer" and don't use other options
After you connect the device to your computer use the following commands to make a wireless connection
You need to ensure that both your android device and your computer are on the same wi-fi network.
The following commands are used on the ubuntu 16.04 terminal. The commands can be somewhat different in case you are using windows, mac or any other version of linux.
Change directory to the folder where adb tools exist
this was the address to the folder on my computer where android sdk was installed. For your machine it would be different.
Kill server to reset any existing connections
Use this command to reset the connection. This is required when there is a drop of connection and things do not seem to be working for any other reason.
Start an adb server
./adb tcpip 5555
Use this command to start the ADB server
Connect wirelessly to the android device
./adb connect 192.168.43.114
The IP address is the host address of your android device on the wireless network
Creating wireless connection the next time
Once you have made a wireless connection. You do not need to physically connect your device to the development machine again and again. You can simply use the above commands to establish the wireless connection.
Although it might seem like a complicated process in the beginning. But once you establish the connection it gets a lot simpler the next time.
And yes the comfort it offers to just connect your device with your development machine through wi-fi is surely worth the pain and efforts you are putting in making the connection !