set up device for development (???????????? no per

2018-12-31 16:55发布

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 directly on the Samsung handset device, so I performed the following setup steps:

  1. in my project AndroidManifest.xml file, added android:debuggable="true" to the <application> element

  2. On the device, in the Settings > Security enabled Unknown sources

  3. On the device, in the Settings > Developer options enabled USB debugging

  4. On my computer, created the /etc/udev/rules.d/51-android.rules file with the following content:

    SUBSYSTEM=="usb", ATTR{idVendor}=="04E8", MODE="0666", GROUP="plugdev" 
    
  5. On my computer, run the chmod a+r /etc/udev/rules.d/51-android.rules command

Then, on my computer I opened a terminal and executed the adb devices command, I got:

List of devices attached 
????????????    no permissions

Since I did not see my device but only ???????????? no permissions, I then run the following commands:

 adb kill-server
 adb start-server
 adb devices

But I still got:

List of devices attached 
????????????    no permissions

Why? What am I missing?

23条回答
低头抚发
2楼-- · 2018-12-31 17:45

I used su and it started working. When I use Jetbrains with regular user, I see this problem but after restarting Jetbrains in su mode, I can see my device without doing anything.

I am using Ubuntu 13.04 and Jetbrains 12.1.4

查看更多
人间绝色
3楼-- · 2018-12-31 17:47

My device is POSITIVO and my operational system is Ubuntu 14.04 LTS So, my problem was in variable name

I create the file /etc/udev/rules.d/51-android.rules and put SUBSYSTEM=="usb", SYSFS{idVendor}=="1662", MODE="0666"

I disconnected device and execute:

$ sudo udevadm control --reload-rules
$ sudo service udev restart

after this i connected the android device in developer mode again and

$ adb devices

List of devices attached 
1A883XB1K   device
查看更多
像晚风撩人
4楼-- · 2018-12-31 17:50

Enter the following commands:

adb kill-server sudo ./adb start-server adb devices

The issue is your not running adb server as root.

查看更多
泛滥B
5楼-- · 2018-12-31 17:50

GitHub community maintained udev-rules

https://github.com/M0Rf30/android-udev-rules/blob/master/51-android.rules

This is the most complete udev-rules list I've seen so far, even more than the currently recommended sudo apt-get install android-tools-adb on the official documentation, give it a try.

查看更多
刘海飞了
6楼-- · 2018-12-31 17:51

What works for me is to kill and start the adb server again. On linux: sudo adb kill-server and then sudo adb start-server. Then it will detect nearly every device out of the box.

查看更多
梦该遗忘
7楼-- · 2018-12-31 17:52

When you restart udev, kill adb server & start adb server goto android sdk installation path & do all on sudo. then run adb devices it will solve permission problem.

查看更多
登录 后发表回答