Recently i was working on a project in android studio. I prefer to use Linux as the OS when i develop android applications since it runs pretty fast in linux rather than Windows. But suddenly my laptop got stucked and i found that the reason for that is sudden mount/unmounts of the smartphone due to a problem in the USB cable i used. This was really annoying and suddenly this thought pops into my mind, “why don’t i connect this via WiFi?” because I have done pretty much the same thing in one of my previous project to manually (over terninal) push/install/unstall apks in the device. The method you need to follow is like this,
01) Make sure you have setup the environmental variables in your OS to run “adb” command. To test that just open the termial (in windows command prompt) and type adb and press enter. If you got a response from adb tool everything is okay. Otherwise, set the environmental variable depending on your OS. You can find the path to the adb tool in the following directory.
[path to your android sdk]/platform-tools/
02) The next thing you need to know is obviously the IP address of the andorid device you need to connect. After connecting to the WiFi networkj you can find the Phone’s IP address from [Settings>About phone>Status].
Now type the following command and hit enter in terminal to connect to your device.
adb connect type_the_device_ip_address_here
After that, you could see the connected device in the connected devices list in android studio 🙂