开发者

Can't connect to Android via ADB over wifi - Do I need root access?

I'm basically trying to do this: How can I connect to Android with ADB over TCP? with the Droid X2.

I have USB Debugging on, and my phone is plugged in via USB. The IP Address is 10.0.78.33 (I have verified that I can do TCP communication to the phone on that IP, and I can ping it).

I go to th开发者_如何学Pythone command line and do the following:

>>adb tcpip 5555

restarting in TCP mode port: 5555

>>adb connect 10.0.78.33:5555

unable to connect to 10.0.78.33:5555

Any thoughts on why this doesn't work? Do I need root access in order to do this? I'm trying to avoid rooting the phone.

Thanks!


Step 1 . Go to Androidsdk\platform-tools on PC/Laptop

Step 2 :

Connect your device via USB and run:

adb kill-server

then run

adb tcpip 5555

you will see below message...

daemon not running. starting it now on port 5037 * daemon started successfully * restarting in TCP mode port: 5555

Step3:

Now open new CMD window,

Go to Androidsdk\platform-tools

Now run

adb connect xx.xx.xx.xx:5555 (xx.xx.xx.xx is device IP)

Step4: Disconnect your device from USB and it will work as if connected from your Android studio.


Symptoms

With my phone, this problem happens a lot. I get these symptoms:

  • ping x.x.x.x times out
  • adb connect x.x.x.x times out ("unable to connect")
  • telnet x.x.x.x 5555 times out

Workaround

I need to disable and re-enable WiFi on my phone before running adb connect on my computer. Then I can both ping, telnet, and adb connect to the phone.

I'm using a Sony Xperia M C1904 running CyanogenMod 12.1.


Your device hasn't to be rooted. I've developed a plugin for IntelliJ/Android Studio to connect your device over wifi pressing just one button. Here is the code and here the plugin ready to be used.

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

Can't connect to Android via ADB over wifi - Do I need root access?


In my case i need pair device with code.

  1. in phone "For developers" -> "Wifi debug" -> "Connect with code"
  2. adb pair x.x.x.x:xxxxx password
  3. adb connect x.x.x.x:xxxxx


Root IS needed to change that system properties. However, it is not needed to start adb over wifi.
You can forward the ports while connected through USB and then tell the adb daemon to listen over a certain frequency:
ADB over wirless


I've encoutered the same problem, and my device was rooted. The problem actually came from adbd Insecure. If you installed adbd Insecure on your device, it will prevent you from connecting to your device via WiFi. You have to uncheck the "Enable insecure adbd" in the app adbd Insecure.

See FIXED: Can't connect to adb over wifi


The problem with me for my Samsung Tab 1 was an adb process was already running on port 5037 on my Xubuntu 14.04 machine, which I was unaware about until I typed pgrep -l -u username. To fix this, I terminated the adb process using pkill adb, navigated to my platform tools folder and ran adb tcpip 5037 and then connected to my device using the 5037 port number. Boom! Worked like a charm.


Android wifi ADB was earlier working on my IDE but after Updating Android Studio (my current is Android Studio 3.3) it is not working and always prompt as "Unable to connect to device......Same network"

After spending much time i was unbale to resolve the issue.

Then i tried - WIFI ADB ULTIMATE by

https://github.com/huazhouwang/WIFIADB/tree/master/WIFIADBIntelliJPlugin

It worked for me.


I know it's an old thread and OP is asking in very common scenario but I would like to mention what happened with me.

I was able to connect to ADB over wifi through below steps:

  • connect android phone to computer via USB (critical initial step)
  • open terminal in android studio & navigate to where the adb is installed
  • execute command adb tcpip 5555. this will restart the adb in TCP mode port: 5555
  • execute command adb connect <ip address>
  • for first time you might need to give access to adb from phone when asked
  • after connection establishes, you can disconnect the usb cable and you're good to go.

This worked all the time when I'm on my home wifi.

Twist:

I got the error saying failed to connect to '172.16.224.20:5555': Connection refused, when i tried to connect from Starbucks cafe wifi (or any other public wifi).

After some research I realized that

many public wifi has some configuration restrictions which doesn't allow adb over wifi

.


I couldn't connect adb to my Nexus5 Phone over 5Ghz WLAN but it did work with the slower 2,4 Ghz instantly.


After you run setprop service.adb.tcp.port 5555 and restart adb you won't see the device if you run adb devices on the host.

Instead, you have to run adb connect 10.0.78.33:5555


I hope this will helpful and worked for me

  1. Disconnect phone from studio.
  2. Go to developer options in phone.
  3. Under USB debugging, there is an option to Revoke USB debugging authorisations.
  4. Then click ok.
  5. Then again connect phone to studio via USB.
  6. Then click on connect button in ADB Wifi.
  7. Now you can run and debug apps without USB


Restart your adb server with higher port. I was trying to use adb on 5555 port but it didnt connect and when i started server on 50370 it connected instantly

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜