admin管理员组

文章数量:1313736

for some time whenever I attach an Android device and is not set up to "File transfer" option ADB crashes.
Going through ADB startup logs I find the following error: connection terminated: failed to open device: Access denied (insufficient permissions)

This is the output of adb --version:

Android Debug Bridge version 1.0.41
Version 35.0.2-12147458
Installed as /home/user/Android/Sdk/platform-tools/adb
Running on Linux 6.11.0-108013-tuxedo (x86_64)

Running on TuxedoOS 24.04

Anything I can do from stopping the crashes?

for some time whenever I attach an Android device and is not set up to "File transfer" option ADB crashes.
Going through ADB startup logs I find the following error: connection terminated: failed to open device: Access denied (insufficient permissions)

This is the output of adb --version:

Android Debug Bridge version 1.0.41
Version 35.0.2-12147458
Installed as /home/user/Android/Sdk/platform-tools/adb
Running on Linux 6.11.0-108013-tuxedo (x86_64)

Running on TuxedoOS 24.04

Anything I can do from stopping the crashes?

Share Improve this question asked Jan 31 at 7:16 adiadi 4796 silver badges29 bronze badges 2
  • Have you created a udev rule that allows you to access the adb device without root permissions? If file transfer mode is not active the Android phone only exposes one USB device: the "adb device". If case file transfer is enabled it exposes three devices: 1. the USB compound device, 2. the file transfer/MTP device 3. the adb device. If you have an udev rule my guess is that you have created it for the USB compound device which is not present when you disable file transfer mode. – Robert Commented Jan 31 at 9:06
  • @Robert, hi and thank you for replying. I haven't done any udev rules. I noticed that this might be a case of permissions issue. I noticed that if I use the adb from the distro's repository and I do adb kill-server/start-server, the issue disappears, with the issue reappearing at system restart. – adi Commented Feb 1 at 8:29
Add a comment  | 

1 Answer 1

Reset to default 0

The issue you're experiencing with ADB crashing when the phone is not set to "File transfer" mode is likely due to insufficient permissions. Here are a few steps you can take to resolve this issue:

  1. Update ADB: Ensure you have the latest version of ADB.

  2. Udev Rules: On Linux, you may need to set up udev rules to grant the necessary permissions to ADB. Create a file named 51-android.rules in the /etc/udev/rules.d/ directory with the following content:

    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
    

    Replace 18d1 with the vendor ID of your device. You can find the vendor ID by running lsusb with your device connected.

  3. Restart Udev: After creating the udev rules file, restart the udev service:

    sudo udevadm control --reload-rules
    sudo service udev restart
    
  4. Add User to Plugdev Group: Ensure your user is part of the plugdev group:

    sudo usermod -aG plugdev $USER
    
  5. Reboot: Reboot your system to apply the changes.

  6. Check Permissions: Ensure that the ADB server has the necessary permissions to access the device. You can restart the ADB server with elevated permissions:

    sudo adb kill-server
    sudo adb start-server
    

By following these steps, you should be able to prevent ADB from crashing when the phone is not set to "File transfer" mode.

本文标签: