1

I'm trying to develop using Android Studio 3.1.2 and a ZTE Z557BL running Android 7.1.1. For some reason my computer usually can't find my device, but sometimes it does. When it doesn't appear I use adb kill-server and adb start-server repeatedly, clean my project, restart both devices, etc. Nothing seems to work until the device inexplicably appears in the deployment targets. This is slowing development down tremendously and I'd love a fix or something to try if somebody can possibly help.

rharding
  • 421
  • 3
  • 12
  • Is it a physical device or virtual? If it's a physical device have you tried a different USB cable or tried debugging via wifi? – Bakon Jarser Sep 17 '18 at 22:27
  • It's a physical device. The virtual devices show up just fine. I haven't tried another cable but I didn't know there was a wifi option. How do I enable that? – rharding Sep 17 '18 at 22:33
  • https://stackoverflow.com/questions/4893953/run-install-debug-android-applications-over-wi-fi – Bakon Jarser Sep 17 '18 at 22:35
  • Testing over wifi isn't working because when I run adb devices the device isn't found – rharding Sep 17 '18 at 22:36
  • Some devices can enable wifi debugging in the developer options. Otherwise you'll have to get adb to recognize the device once and then it should stay in wifi mode until you reboot or tell it to go back to usb mode. – Bakon Jarser Sep 17 '18 at 22:41
  • Okay cool, thank you @BakonJarser . I also just ordered another cord to see if that helps – rharding Sep 17 '18 at 23:22

2 Answers2

1

You can ignore this problem by debug over wifi. Here are some steps to do that:

  1. Connect your pc and mobile to the same wifi

  2. start tcpip

adb tcpip 5555

restarting in TCP mode port: 5555

  1. get ip address

adb shell ip addr show wlan0 | grep 'inet ' | cut -d' ' -f6|cut -d/ -f1

192.168.0.18

  1. connect to ip

adb connect 192.168.0.18

connected to 192.168.0.18:5555

Now, you can reject your cable and start dev & debug over wifi

Robust
  • 2,095
  • 2
  • 19
  • 33
0

sounds like a faulty cable (especially if you hear "the connection/disconnection" sound repeatedly).

Try to uninstall the the driver and reinstall it again as well (adb driver for that device)

Snake
  • 12,886
  • 20
  • 99
  • 231