set up device for development (???????????? no permissions)

后端 未结 26 2037
再見小時候
再見小時候 2020-11-22 12:27

I am using a Samsung galaxy nexus phone (Android 4.0 platform) .

I am developing Android app on Ubuntu linux OS. I would like to run my application

26条回答
  •  盖世英雄少女心
    2020-11-22 13:25

    For those using debian, the guide for setting up a device under Ubuntu to create the file "/etc/udev/rules.d/51-android.rules" does not work. I followed instructions from here. Putting down the same here for reference.

    Edit this file as superuser

    sudo nano /lib/udev/rules.d/91-permissions.rules
    

    Find the text similar to this

    # usbfs-like devices 
    SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, \ MODE=”0664″
    

    Then change the mode to 0666 like below

    # usbfs-like devices 
    SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, \ MODE=”0666″
    

    This allows adb to work, however we still need to set up the device so it can be recognized. We need to create this file as superuser,

    sudo nano /lib/udev/rules.d/99-android.rules
    

    and enter

    SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, ATTRS{idVendor}==”0bb4″, MODE=”0666″
    

    the above line is for HTC, follow @grebulon's post for complete list.

    Save the file and then restart udev as super user

    sudo /etc/init.d/udev restart
    

    Connect the phone via USB and it should be detected when you compile and run a project.

提交回复
热议问题