user1788294
user1788294

Reputation: 1893

adb devices does not show my device every now and then

Sometimes when you do adb devices it lists your device , while next moment when you do adb devices it doesn't show my devices.

I am using it for automating a workflow and adb disconnects with my Nexus frequently in between causing it to fail. I am on MAC. I know one solution is to restart adb server or reconnect the device but I cannot use these solutions in between the workflow

Please help

Upvotes: 2

Views: 2575

Answers (5)

Sameer
Sameer

Reputation: 11

I faced similar problem, which got resolved after replacing USB cable.

Upvotes: 1

jonathanzh
jonathanzh

Reputation: 1454

If devices are physically connected via USB and adb kill-server does not help to fix the issue, one possibility is that your device is not properly configured for development. Run “Settings”, and make sure that:

  • “Developer options” is ON.
  • “USB debugging” is ON.

(Both need to be ON). Now try again to restart adb server.

In the past I used to have a similar issue: Sometimes adb devices lists my device, but sometimes it does not. When it does not list my device, I have noticed that “USB debugging” has (accidentally) been turned off. Turning it back on has fixed the issue for me. Sure this is only one possibility that may not apply to your case. So it's just one item in your checklist.

Upvotes: 0

dipali
dipali

Reputation: 11188

use in command prompt call adb kill-server and then call adb devices

I hope its useful to you.

Upvotes: 0

mgokgoz
mgokgoz

Reputation: 186

I don't understand why you can't restart ADB in workflow? Could you provide anything you have donw so we can check. If you're doing an automation/tool that use adb commands, you can get the adb status and depending on that value you can do whatever you need to do. Use

adb wait-for-device

If device couldn't be reached after some time, throw an error.

Upvotes: 0

Razgriz
Razgriz

Reputation: 7343

You can try running this on the Terminal

adb kill-server

adb start-server

You need to get the Android debug Bridge (ADB) for that.

Upvotes: 0

Related Questions