Enable usb debugging in Android. (I am using kitkat)
connect phone with usb. In notification you will see: "USb Debugging Connected".
Open terminal and run:
adb devices # you will see devices list
------ start output ------
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
0123456789ABCDEF device
------ end output ------
- Then run: (it can take half minutes)
$ adb tcpip 5555
------ start output ------
restarting in TCP mode port: 5555
------ end output ------
After showing this message terminal will be active. Active means, terminal is ready to take another command.
Note: if this command is stuck. Run "$ adb kill-server" and try "step 4"
Disconnect USB
Go to the Settings -> About phone -> Status to view the IP address of your phone.
-
Then run:
$ adb connectsuppose I run: "$ adb connect 192.168.0.101"
------ start output ------
connected to 192.168.0.101:5555
------ end output ------
Note: If it does not work, you can try with port number: "$ adb connect 192.168.0.101:5555"
- Now you check the connected devices, run: $ adb devices
------ start output ------
List of devices attached
192.168.0.101:5555 connecting
------ end output ------
Note: if you see connecting like me, try "step 9"
- In android phone,
- Turn off usb debugging, and then turn on usb debugging. or, turning off and on Developer's Option again from Settings
- Then run: "$ adb connect "
- Then run: "$ adb devices" Now you should see,
------ start output ------
List of devices attached
192.168.0.101:5555 device
------ end output ------
Special Note: Still you need to enable "USB DEBUGGING" to debug over WIFI