-1

I would like to transfer files between a phone (Harmony 2.0.0) and a Linux laptop with USB connection between them. I try to use adb by following https://www.reddit.com/r/linuxquestions/comments/hde7f4/enable_linux_mounting_of_android_usb_device_for/fvl8gyp/, but why do I have the permission problem?

$ adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
A7Q0218123000244    no permissions; see [http://developer.android.com/tools/device.html]



$ adb shell
adb: insufficient permissions for device
See [http://developer.android.com/tools/device.html] for more information

I can't find anything useful in the link http://developer.android.com/tools/device.html

4
  • 1
    Did you try visiting those links in the output?
    – muru
    Commented Jul 3 at 13:37
  • "I can't find anything useful in the link" Really? From the link: "Each user that wants to use ADB needs to be in the plugdev group." Could be something that's relevant for permissions, no?
    – muru
    Commented Jul 4 at 1:45
  • @muru, If so, could you combine your finding with Artem's answer which doesn't mention what you found?
    – Tim
    Commented Jul 4 at 13:05
  • The link also mentions udev, you should check whether it matches what Artem's answer says, first.
    – muru
    Commented Jul 4 at 13:30

1 Answer 1

3

You either have to

  • run adb under root/sudo
  • or create a udev rule for your Android device, e.g. something like:
/etc/udev/rules.d/99-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="abcd", MODE="0660", GROUP="user"

Or you can remove , GROUP="user" from above and change mode to 0666.

You can get the vendor ID by using the lsusb command. After ID you'll see VENDOR:DEVICE.

7
  • Thanks. (1) For the part in ATTR{idVendor}=="...", is it 12d1 according the output of lsusb in my unix.stackexchange.com/questions/779420/…? (2) If I have more than one phones (Honor 10 and Moto G Pure), and I may want to connect either to the Linux laptop, what shall the content of /etc/udev/rules.d/99-android.rules be like?
    – Tim
    Commented Jul 4 at 12:56
  • You may have multiple SUBSYSTEM ... strings in this file or create multiple files with different idVendor's. Or you can have a single line and file and use | for different idVendors, e.g. ATTR{idVendor}=="abcd|cdef|1234" - though I've not tested it. Personally I've created multiple files and named them according to the vendor. You can check /usr/lib/udev/rules.d to see how they are organized. Commented Jul 4 at 13:11
  • sudo adb devices and sudo adb shell both don't solve the problem
    – Tim
    Commented Jul 4 at 13:24
  • First run this sudo killall adb, then try the other commands. Commented Jul 4 at 13:58
  • Thanks. It works.
    – Tim
    Commented Jul 4 at 14:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .