Android Studio recognizes physical Device as Null?

后端 未结 19 1443
攒了一身酷
攒了一身酷 2020-11-30 21:19

I\'ve been developing an Android Application for Android (SDK min version 14) and I have testing it normally with tablets such as Samsung Galaxy 2 and Nex

相关标签:
19条回答
  • 2020-11-30 21:43

    Recently, I was facing the same issue for Vivo and MI phones. I have tried everything described in this thread. I tried connecting as MTP, PTP; But nothing worked.

    After many retries I found a solution for my case and may be it can help others too.

    1. Open terminal window in Android Studio
    2. Kill ADB server using following command: adb kill-server
    3. Restart ADB server using following command: adb start-server

    It solved my issue.

    0 讨论(0)
  • 2020-11-30 21:43

    On ubuntu installing adb worked for me, I think there was some problem with default android studio one .

    In terminal use command

    sudo apt install adb 
    
    0 讨论(0)
  • 2020-11-30 21:44

    Disabling and re-enabling debugging while the device was connected did the trick for me.

    0 讨论(0)
  • 2020-11-30 21:46

    Have the same problem with my Nexus 5/5X/Pixel 2 XL on Ubuntu 18.04.

    A permanent solution is to add a udev rule so that you can always access the device.

    • Find your device with the command lsusb. This outputs e.g. for my Pixel 2 XL this:

      Bus 001 Device 003: ID 18d1:4ee7 Google Inc.
      
      # This means: BUS=001, DEVICE=003, VENDOR=18d1, PRODUCT=4ee7
      
    • Now check the permissions. Replace 001 and 003 with your parameters:

      ls -l /dev/bus/usb/001/008
      
      # Output: crw-rw-r-T 1 root root 189, 8 Nov 10 18:34 /dev/bus/usb/001/003
      # Unless you are root, you are missing the permissions to access the device
      
    • To fix this, create a udev rule file with sudo nano /etc/udev/rules.d/51-android.rules with the following content:

      SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0660", 
      GROUP="plugdev", SYMLINK+="android%n"
      
      # You need to replace "18d1" and "4ee7" with your output of `lsusb` above
      
    • Unplug and plug you device back in. It should now always be recognized. If not, restart the adb server a last time with adb kill-server.

    Source: http://www.janosgyerik.com/adding-udev-rules-for-usb-debugging-android-devices/

    0 讨论(0)
  • 2020-11-30 21:46

    First check adb version:If it gives Output like

    Android Debug Bridge version 1.0.32
    

    Then just restart the daemon.

    sudo adb kill-server
    sudo adb start-server
    

    else install adb first and restart the daemon Worked for me, in ubuntu 16.04.3

    0 讨论(0)
  • 2020-11-30 21:47

    Just run this command after you connect your device to your Ubuntu system:

    adb devices
    

    This works for me.

    Note: Make sure you have selected file transfer option in your phone.

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