Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
111.95k stars 10.71k forks source link

No route to host while connecting with adb connect #1341

Open adarshbalu opened 4 years ago

adarshbalu commented 4 years ago

I checked a lot on stack overflow but still, I can't get this working. This shows every time I use adb connect unable to connect to 192.168.1.100:5555: No route to host

rom1v commented 4 years ago

Are your device and your computer on the same network?

adarshbalu commented 4 years ago

Are your device and your computer on the same network?

Yes . Connected in the same wifi network. I tried restarting both my phone and my pc. I also tried adb kill-server. I looked into a lot of answers on the Internet still no solution.

rom1v commented 4 years ago

Did you adb tcpip 5555?

adarshbalu commented 4 years ago

Did you adb tcpip 5555?

Yes i did. I'll show you the complete screenshot.

rom1v commented 4 years ago

I'll show you the complete screenshot.

(or better, copy-paste the text from your terminal :wink:)

adarshbalu commented 4 years ago

I'll show you the complete screenshot.

(or better, copy-paste the text from your terminal )

adb tcpip 5555

adb connect 192.168.1.200 unable to connect to 192.168.1.200:5555: No route to host

adarshbalu commented 4 years ago

I'll show you the complete screenshot.

(or better, copy-paste the text from your terminal )

Hey

rom1v commented 4 years ago

I don't know. If your device is connected over wifi, if you use its IP address and if your computer is on the same network, it should work.

https://stackoverflow.com/questions/33462720/adb-unable-to-connect-to-192-168-1-105555

adarshbalu commented 4 years ago

I don't know. If your device is connected over wifi, if you use its IP address and if your computer is on the same network, it should work.

https://stackoverflow.com/questions/33462720/adb-unable-to-connect-to-192-168-1-105555

I tried the same post and still does not work. Even kde connect is not working. The device is not showing.

dimashn21 commented 4 years ago

i have same problem

dimashn21 commented 4 years ago

i know,, you must check ip address your phone again..

williamjnrkdd commented 4 years ago

So my situation was that i restarted it in tcp mode but still couldn't connect, i had the same error ie no route to host, so i tried pinging it but i couldn't find it either even though it was on the arp table. so what i noticed was that when i connect it by usb, it pings successfully. so i had to do the adb connect ip before i could unplug the usb.

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 4 years ago

I created this tool to ease wireless connectivity. Check it out and let me know of your experience.

https://github.com/fusionneur/ethernally

codrikaz commented 2 years ago

i'm also facing the same problem.!!

Abhishek-EE commented 1 year ago

I was having the same issue but after looking at @williamjnrkdd I decided to look at arp table and the HWaddress was incomplete. After digging in a bit it turns out the MAC address on my android was randomized which made it impossible to establish connection with even when I was using ping. Ideally go to settings search for Wifi Mac Address and disable the random mac address and use the phone address instead. Then you also need to go to developer option and follow this post https://developer.android.com/studio/run/device for adding your linux system to your android debugging tools. and then try pinging the ip of your phone from your machine and it should work. @coddrikaz hope this helps

richardwojc commented 1 year ago

how about with usb

Mohsin81 commented 10 months ago

@richardwojc we're talking about WIRELESS adb here, know what that means jerry?.

Anyway after getting the same problem i was able to solve it by restart the wifi router -> after connecting get my phones ip address from the routers app -> did "adb connect ip:5555" -> voila "adb devices". No Usb needed

uvlad7 commented 6 months ago

It worked for some reason when I reserved an IP for watches' MAC in my router DHCP settings.

VishnuRathore98 commented 2 months ago

Was facing the same issue, the following worked for me:

  1. Connect your device with usb(make sure usb debugging is enabled).
  2. Execute: adb usb.
  3. Execute: adb tcpip 5555 (this will restart in TCP mode on port 5555).
  4. Execute: adb connect 192.168.1.3:5555 (this will connect your device using IP:PORT).

Now, from next time you just need to execute the last command using proper device's IP and 5555 port.

jamescl131 commented 1 month ago

Same issue, but running the following resolved it for me.

adb kill-server adb start-server adb usb adb tcpip 5555 scrcpy --tcpip=IP Address -Sw

(I wanted Sw switches, these are optional for keep screen unlocked and turn screen off when you're connected)

cHAuHaNz commented 6 days ago

This worked for me as well:

adb kill-server adb start-server adb usb adb tcpip 5555 adb connect

zailaib commented 4 days ago
  1. same wifi connectd of you phone and pc
  2. set usb debug mode on your android device first
  3. connect the Cable between phone and you pc
  4. run commands : adb kill-server && adb start-server && adb tcpip 5555 && adb connect
  5. now you can remove connected of the USB cable

do not run adb usb