Insufficient permissions for device in Android Studio Workspace running in openSUSE 13.2

portsample picture portsample · Feb 24, 2015 · Viewed 99.5k times · Source

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]

listed in the Choose Device window, with the Logcat window showing

insufficient permissions for device

I would really like to use this device and ROM for debugging purposes.

When I enter lsusb from the command line I get,

Bus 002 Device 002: ID 22b8:431d Motorola PCS

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.

I've also tried Revoke USB debugging authority, from Developer Options on the device, with no luck.

I have not tried running ASW as root hoping that there might be another option; is there?

Update: I was able to get in and access ADB by

uvachem-gsmith2:/home/greg/Android/Sdk/platform-tools # ./adb

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...

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.

Answer

cro picture cro · Jan 16, 2016

I had this while using a Linux machine with a Nexus 4 running Android 5.1

The fix was to enable both 'debug over USB' and 'connect as MTP'. The opposite is true when using the same device and Android Studio and adb on OSX though - to allow Android Studio to recognise the handset, I need to disable 'connect as MTP'.