android studio doesn't detect my device on my ubuntu laptop

前端 未结 9 1648
伪装坚强ぢ
伪装坚强ぢ 2021-01-02 00:31

I am trying to run an app from Android Studio on my Ubuntu laptop.

I have enabled USB debugging, but it is still not working.

When I press run

相关标签:
9条回答
  • 2021-01-02 01:12

    Make sure you have adb installed in your ubuntu system. If not then type -

    sudo apt-get install adb
    

    Provide your system password and press 'Y' asked during installation process.

    Then disconnect your device through USB and then reconnect it. You will have to grant permission for debugging which prompts on your device just after reconnecting.

    0 讨论(0)
  • 2021-01-02 01:12

    Try to revoke USB debugging authorizations and then connect your device, it should show permission prompt for authorization.

    go to

    settings -> developer options -> revoke USB debugging authorizations.
    
    0 讨论(0)
  • 2021-01-02 01:16

    I tried restarting adb using root priviledges and it worked for me. Use these commands in the terminal:

    sudo adb kill-server
    sudo adb start-server
    

    Hope it works for you too...

    0 讨论(0)
  • 2021-01-02 01:18
    1. if you are doing it first time in Ubuntu Linux, then Use sudo apt-get install to install the adb package. This gives you a community-maintained default set of udev rules for all Android devices.

    2. or, use sudo adb kill-server sudo adb start-server and check using sudo adb devices

    3. you can also check uncheck the usb debugging option, in your developer option in the phone.

    follow this link for more info. Run apps on a hardware device

    0 讨论(0)
  • 2021-01-02 01:19

    For my situation with Ubuntu 16.04, with my device properly connected via USB, confirmed by lsusb

    The solution is let the Studio aware of the Android/Sdk folder by defining

    export ANDROID_HOME=<the Android/Sdk folder>
    

    in ~/.bashrc

    (I have installed the SDK at a custom location)

    Then start a new shell, from there re-start the studio, then it works.

    0 讨论(0)
  • 2021-01-02 01:21

    I solved with this: https://stackoverflow.com/a/37109216/5081063

    If the problem is only on Android Studio and not in your OS you can solve with that.

    So first check if adb recognize any devices with:

    $ adb devices
    

    If yes, open Android Studio and follow these steps:

    1. Go to Run > Edit Configurations...
    2. Under Deployment Target Options select Show Device Chooser Dialog from the drop-down-list

    0 讨论(0)
提交回复
热议问题