简体   繁体   English

无法通过USB连接的Nexus 5x上的开发

[英]Development on Nexus 5x which cannot connect via USB

I faced an issue with my Nexus 5x which I just acquired for Android 8 development: even after setting the development mode to be on, USB debugging to be on, Android Studio or adb refused to see it. 我刚为Android 8开发而购置的Nexus 5x遇到了一个问题:即使将开发模式设置为开,USB调试为开,Android Studio或adb也拒绝看到它。 (On the other hand, my Nexus 6 works fine...) Tried a few USB-C wires (including one that said compatible with Nexus 5x). (另一方面,我的Nexus 6正常工作...)尝试了几根USB-C线(包括一根据说与Nexus 5x兼容的线)。 and the result is the same. 结果是一样的。

I am using a Mac. 我正在使用Mac。

1) Is this a hardware defect or is it a USB mode I need to set? 1)这是硬件缺陷还是我需要设置的USB模式? 2) If it is not possible to connect, how do I do wireless development (without connecting via wire first)? 2)如果无法连接,该如何进行无线开发(首先不通过有线连接)?

First of all you need to check if your device is showing in adc command shell using this command : adb devices 首先,您需要使用以下command检查设备是否在adc command shell显示: adb devices

if you device is showing then it's good and if not you need to make sure that Media device (MTP) is disabled. 如果您的设备正在显示,那就很好,如果不是,则需要确保已禁用Media device (MTP) When it's disabled adb devices lists the device, when enabled it does not. 禁用时, adb devices列出该设备,启用时则不会。 After that go through the following process 之后,请执行以下过程

  • Run adb tcpip 5555 运行adb tcpip 5555

  • Disconnect your device (remove the USB cable). 断开设备的连接(拔下USB电缆)。

  • Go to the Settings -> About phone -> Status to view the IP address of your phone. 转到设置->关于手机->状态以查看手机的IP地址。

  • Run adb connect :5555 运行adb connect:5555

more you can follow up with this Link . 您还可以继续使用此链接

And the second option is open your android studio go to 第二个选项是打开您的android studio进入

file -> settings -> plugins -> search adb wifi

install that plugin and follow the steps. 安装该插件并按照步骤进行。 More you can read about adb wifi is here: 您可以在这里了解更多有关adb wifi的信息:

Android Wifi ADB Android Wifi ADB

Github link Github链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM