Unable to connect to my android device via ADB

匿名 (未验证) 提交于 2019-12-03 02:49:01

问题:

Sorry for the nooby question, I am having trouble sorting this out using the web.

I am trying to simply connect my device to my pc via adb to debug my application.

My device is rooted. Adb debugging is enabled. I downloaded an adb running application and started ADB.

Now i am trying adb connect ip:5555. and keep on getting "unable to connect to ip:5555" ...

Same happend when i try to connect via usb.

c:\>adb connect 192.168.20.191:5555 unable to connect to 192.168.20.191:5555 

Help...?

EDIT: C:>adb devices List of devices attached 06fecaa1 unauthorized

回答1:

Launching Cordova

  1. Open Node.js / CMD
  2. Point to "the directory where you have located your source folder" >>> C:\Projects\RJX
  3. Enable Wifi
  4. Turn on Developer Option under settings
  5. Enable / Check USB Debugging Option under settings (Google if cannot find this option)
  6. Enable / Check the MTP Option under settings (Google if cannot find this option)

ADB Commands

adb kill-server adb start-server //plug off cable from mobile and plug in again if you connected your device earlier //Uninstall the application from mobile if you already installed. (if necessary) adb tcpip 5555 adb connect "ip" //adb connect 192.192.2.128 adb devices //to check device details cordova run android --device 

if this steps are not worked, try to close the cmd and do it again. Sometimes it needs some refresh. **Android devices version 4.0.4 and after should be no problem if you follow these steps.



回答2:

I will assume you are able to understand adb connect / ip's etc I won't bore you with that

but there are two lame "gotcha's"

THE GENYMOTION GOTCHA

genymotion WRECKS a lot of this sometimes.. I am sorry but it does.. it has a "I know what I am doing I am taking over" mentality.. sadly it doesn't know what it's doing :-P often you have to turn off genymotion for the adb->usb to work.. basically connect phone FIRST ... make sure it's there in eclipse (adb kill-server / start server if needs be ), then AND ONLY THEN then genymotion AFTER

THE OOPS [/facepalm] GOTCHA

check that your phone it isn't in Windows merely as a "Camera" - go to My Computer and look. If it looks like this pic it's that you're not running Samsung Kies(/disabled because it's annoying) the phone still goes "blub bling" when you plug it in, it may be connected via wifi so have a LAN ip but it is NOT really "connected" to ur PC.

instead run/download/update this (with phone disconnected) then make sure Kies is happy AND MAKE SURE MTU is enabled



回答3:

This error happened to me when PC was (accidentally) NOT in the same network as Android. When I logged on Android to the same WIFI network as PC it now works perfect and I don't have this problem.



回答4:

The answer here is that it's not listening on the correct (default) port. So you need to set the TCP/IP port to 5555. Connect your device via USB and issue the following command in cmd (terminal):

adb tcpip 5555 

Following this your adb connect should work fine, e.g.:

adb connect 192.168.0.n 

Hope this fixes it for you.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!