43

I am trying to connect ADB using WIFI on my non rooted android devices. Currently i have 3 android devices out of which 2 are running on Android 4.0.4 and 1 on 2.3. My device IP's are 192.168.2.122, 192.168.2.131, 192.168.2.115

I have enabled USB debugging on all of them and follow all the steps as listed here

On the command line, I did the following

adb tcpip 5555
restarting in TCP mode port:5555 
adb connect 192.168.2.131

My problem is on one of my device(Android 4.0.4) ADB is getting connected with the message saying

connected to 192.168.2.122:5555

However when i try connecting other it says

unable to connect to 192.168.2.131:5555

Screenshot of the terminal page: Screenshot of the terminal page:

Image of terminal on the connected device: enter image description here

Image of terminal on device which is not getting connected: enter image description here

Many of the posts on Stack Over Flow says i need to root my phone for the same but the device on which ADB is getting connected is also not rooted.

May be the problem with the devices not getting connected is that their ports are not getting listened.

Any help appreciated.

2
  • 1
  • Thanks for the quick reply Sahil, i have done the same and adb is connected to one of the device also but for the other devices adb is not getting connected. Please help if possible how to connect all of my devices. Jan 16, 2013 at 13:28

6 Answers 6

71

I had the same problem.

I firstly connected my Android4.0.3 based device via USB and set the TCP/IP port to 5555

$ adb tcpip 5555

After that I disconnected USB connection and connected to device via WiFi IP and it worked.

$ adb kill-server
$ adb connect 192.168.2.5 
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to 192.168.2.5:5555
6
  • 1
    Is your device rooted? I have an non-rooted device but its failing to connect. Jan 2, 2014 at 6:42
  • This worked for me on a rooted HTC Hero running Android 2.3.7 - thanks!
    – Garoke
    May 4, 2014 at 9:42
  • This is not an answer to the question for non rooted devices without USB connection.
    – user458577
    May 8, 2014 at 12:45
  • Make sure: that you do not have Android studio running before executing the - 'restart adb in tcpip mode' command. Feb 24, 2015 at 20:37
  • Working on Android 6.0.1 without any issue. Thanks :) Oct 17, 2016 at 4:19
24

The steps are correct, with one small part different: the connect step has to be done after taking out the cable. To reiterate follow the steps exactly as below and it will work for non-rooted devices also. I tested it with several non-rooted devices including Moto G, Nexus 1, Videocon etc.

  1. Attach mobile via USB and type:

    adb tcpip 5555
    
  2. To find the mobile ip type:

    adb shell ip -f inet addr show wlan0
    

The ip address will be shown in second line like this:

inet 192.168.1.233/24 brd 192.168.1.255 scope global wlan0

where 192.168.1.233 is the ip address of your mobile.

  1. Remove USB cable and type:

    adb connect mobile-ip:5555
    
2
  • Make sure: that you do not have Android studio running before executing the - 'restart adb in tcpip mode' command. Feb 24, 2015 at 20:38
  • If you have IDE running then adb may have been already started and you may need to restart it in some cases: adb kill-server; adb start-server Jul 18, 2015 at 7:13
8

After read this question I decided to create a easy to use solution to fix this problem. You can use an open source IntelliJ Plugin I've developed. Here is the code and here the plugin ready to be used.

The usage is quite simple. Here you have a gif:

enter image description here

Remember that old devices using an Android 2.X does not support this Android Debug Bridge feature. That's why you can't connect the device you show in the screenshots.

3
  • This error is coming "adb command not found, review your andorid sdk Installation" error when i run this plugin.You have any idea how to resolve that.
    – Aman Jham
    Oct 23, 2015 at 7:32
  • I've just tried it, any way to speed up apk install? It is taking longer than via usb.
    – Nick
    Dec 6, 2016 at 1:11
  • Hi Nick! It's not possible to speed up the installation from the plugin code. Sorry. The only way you could improve the installation time is to get a faster WiFi connection or a faster ADB. The plugin is just executing commands programmatically. Cheers! Dec 14, 2016 at 12:30
7

It works perfect with android 4.0.4. but, below that it does not works. so, the answer to your problem is to upgrade all devices to 4.0.4.

3

Screenshot of the terminal page

first connect device using USB

then apply the commands....

0

Turn on adb over wifi on your phone enter image description here

Then create file on your desktop ex. 'connect.bat' and paste this code (you have to only change sdk, port and ip):

SET sdk=F:\Praca\sdk\platform-tools
SET port=5555
SET ip=192.168.1.101

cd /dd %sdk%
adb tcpip "%port%"
adb shell netcfg
adb connect  "%ip%:%port%"
echo connected by WiFi
pause
adb -s "%ip%:%port%" usb
echo disconnected
pause

It's really fast and simply solution. Have fun!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.