问题描述
我有一个 root 的摩托罗拉 Defy+,运行由 Quarx 创建的 Cyanogenmod v11 自定义 ROM(每晚构建).使用 Android Studio Workspace,(ASW) v.1.1.0,当我尝试在此设备上调试时,我得到 p>
I have a rooted Motorola Defy+ running a Cyanogenmod v11 custom ROM (nightly build) created by Quarx. Using Android Studio Workspace,(ASW) v.1.1.0, when I try and debug on this device, I get
????????????[null]
列在选择设备窗口中,Logcat窗口显示
listed in the Choose Device window, with the Logcat window showing
insufficient permissions for device
我真的很想将这个设备和 ROM 用于调试目的.
I would really like to use this device and ROM for debugging purposes.
当我从命令行输入 lsusb
时,
When I enter lsusb
from the command line I get,
Bus 002 Device 002: ID 22b8:431d Motorola PCS
这是摩托罗拉设备的正确设备 ID.我已经在 /etc/udev/rules.d/
中安装了 51-android.rules 和 71-android.rules,并在这些文件中使用了正确的摩托罗拉 ID.
This is the correct device id for Motorola units. I have installed 51-android.rules and 71-android.rules in /etc/udev/rules.d/
with the correct Motorola ids in these files.
我也试过在设备上从 Developer Options 中撤销 USB 调试权限,但没有成功.
I've also tried Revoke USB debugging authority, from Developer Options on the device, with no luck.
我还没有尝试以 root 身份运行 ASW,希望可能有另一种选择;有吗?
I have not tried running ASW as root hoping that there might be another option; is there?
更新:我能够通过
uvachem-gsmith2:/home/greg/Android/Sdk/platform-tools # ./adb
然后我做了一个终止服务器,对 root 用户做了一个 SU 并重新启动了服务器.然后我尝试从 Android Studio 连接到设备.在设备上收到一条关于接受来自 PC 的 RSA 密钥的消息,说是",然后能够将应用程序部署到设备.所以回到我最初的问题,是否有另一种方法可以在不以 root 身份登录的情况下访问该设备?手机文件系统似乎存在权限问题阻止了这种情况...
I then did a kill server, did an SU to root user and restarted the server. I then tried to connect to the device from Android Studio. Got a message on the device about accepting the RSA key from the PC, said "Yes" and then was able to deploy the app to the device. So back to my original question, Is there another way to access this device without logging in as root? It seems as if there is a permission issue on the phone file system that is preventing this...
更新#2 这里的核心问题是权限问题.尽管以 root 身份运行 ADB 将允许访问 rooted Android 设备,但更好的解决方案是更改此设备的 udev 文件中的权限...将 664 重置为 666,(请参阅下面的答案).这允许 PC 访问设备上的文件系统.
Update #2 The core problem here was a permission thing. Even though running ADB as root will allow access to the rooted Android device, a better solution is to change permissions in the udev file for this device...resetting 664 to 666, (see answer below). This allows the PC to access the file system on the device.
推荐答案
在/etc/udev/rules.d/51-android.rules 中更改此行中的权限,
Changing permissions in this line from /etc/udev/rules.d/51-android.rules,
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0664", GROUP="plugdev"
到,
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"
以不需要以 root 身份运行 adb 的方式解决了这个问题.
resolves this issue in a manner that DOES NOT require running adb as root.
这篇关于在 openSUSE 13.2 中运行的 Android Studio Workspace 中的设备权限不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!