no target device found android studio 2.1.1

后端 未结 14 1896
暖寄归人
暖寄归人 2021-02-04 23:31

i\'m using android studio 2.1.1 in ubuntu 14.04.Now my question is,i want to run the program through my phone without emulator. so i chose the target as usb dev

相关标签:
14条回答
  • 2021-02-04 23:53

    I had this problem after upgrading from Android Studio 2.3 to 3.0. As simple as it sounds, I actually just restarted my phone to fix it.

    My guess is that the adb server on the phone somehow cached something from the previous installation of android studio, maybe a connection object or something, and by restarting the adb server it resolved the issue.

    I hope this helps someone.

    0 讨论(0)
  • 2021-02-04 23:55

    try with

    sudo adb kill-server
    sudo devices
    

    or

    echo $ANDROID_HOME
    sudo $ANDROID_HOME/platform-tools/adb kill-server 
    sudo $ANDROID_HOME/platform-tools/adb devices
    
    0 讨论(0)
  • 2021-02-04 23:56
    1. Set up a device for development https://developer.android.com/studio/run/device.html#setting-up

    2. Enable developer options and debugging https://developer.android.com/studio/debug/dev-options.html#enable

    Optional

    1. How to enable Developer options and USB debugging
      • Open Settings menu on Home screen.
      • Scroll to About Tablet and tap it.
      • Click on Build number for seven times until a pop-up message says “You are now a developer!”
    0 讨论(0)
  • 2021-02-04 23:56

    If you are using 32-bit ubuntu (my case) then it is most likely that Android Studio has downloaded 64-bit version of adb and fastboot inside your sdk/platform-tools folder. I think you already have installed adb (and fastboot). If you haven't then run these commands in terminal:

    sudo add-apt-repository ppa:nilarimogard/webupd8
    sudo apt-get update
    sudo apt-get install android-tools-adb android-tools-fastboot
    

    This will install 32-bit version of adb and fastboot. Now just replace the 64-bit adb and fastboot executable files in sdk/platform-tools with the installed 32-bit versions:

    cp /usr/bin/adb <path-to-your-adt-sdk-package>/sdk/platform-tools/adb
    cp /usr/bin/fastboot <path-to-your-adt-sdk-package>/sdk/platformtools/fastboot
    

    Now your android studio should be able to run your App in your device.

    0 讨论(0)
  • 2021-02-05 00:00
    1. If suppose the android device is not getting connected by android studio then download "PDANet+"(for all android devices).

    2. Or also you can do these following steps:

      • Go to Run tab on toolbar of android studio.
      • Then click on edit configuration
      • In General tab there will "Deployment Target Option" click on "Target" and choose "Open select deployment target dialog" and uncheck the checkbox from below.
      • And at last click OK. Finish.
    0 讨论(0)
  • 2021-02-05 00:05

    trick that works for me when target device not found:

    • click the "attach debugger to android process" button. (that will enable adb integration for you)

    • click the run button

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