skip to Main Content

I have been facing issue for sometime now. I use ubuntu for development but now the issue I face – Whenever I run adb commands on terminal, Android Studio disconnects weird though I can install the apps via run but logcat, layout inspector which I use frequently would show device as offline.

The issue can be resolved if I reopen Android Studio but it’s kinda hindering my flow of development.

Has anyone faced something similar

2

Answers


  1. It sounds like you are experiencing a conflict between the adb instance used by the terminal and one used by Android Studio.
    This is a known issue and can be quite frustrating.
    Here are a few potential solutions to try.

    1. Restarting adb server.

    Sometimes, simply restarting adb server can resolve the issue.

    1. Ensure only one adb instance is running.

    If you have multiple instance of adb running, they might conflict with each other.

    1. Disable and Re-enable USB Debugging

    Sometimes, simply disabling and re-enabling USB debugging on your device can resolve the issue.

    1. Use a specific adb path.

    Make sure Android Studio and your terminal are using the same adb binary.
    Sometimes, different versions of adb can cause conflicts.

    1. Update Android Studio and SDK tools.

    Sometimes updating can resolve underlying issues.

    1. Check for Hardware Issues.

    Occasionally, issues can arise from faulty USB cables or ports. Try using a different USB cable or port to see if the problem persists.

    1. Using adb over WiFi

    You can also try using adb over WiFi to avoid USB-related issues.

    1. Check android Studio Settings

    Ensure that Android Studio is configured correctly to use the same adb instance as your terminal.

    By following these steps, you should be able to identify and resolve the issue causing adb disconnections between your terminal and Android Studio.

    If you need more information, please send me a mail.

    I wish my answer will help you.

    Login or Signup to reply.
  2. Find how many adb you have installed (it may take some time):

    find / -type f -name adb -ls 2>/dev/null
    

    compare their version and check which one is used by your shell

    type adb
    

    and make your shell and AS use the same.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search