Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting ADB using Wifi for non rooted device

Tags:

android

port

adb

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.

like image 275
Rohit Sangal Avatar asked Jan 16 '13 12:01

Rohit Sangal


People also ask

How do I connect to ADB without cable?

Android WIFI ADB is a plugin available in Android Studio that helps you to connect your system to devices over a Wi-Fi network. It allows you to quickly connect your Android device over Wi-Fi by pressing one button, to install, run, and debug your applications without a USB connection.


2 Answers

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 
like image 186
Munish Avatar answered Nov 01 '22 16:11

Munish


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 
like image 27
Angsuman Chakraborty Avatar answered Nov 01 '22 14:11

Angsuman Chakraborty