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?
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:
Update ADB: Ensure you have the latest version of ADB.
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.
Restart Udev: After creating the udev rules file, restart the udev service:
sudo udevadm control --reload-rules
sudo service udev restart
Add User to Plugdev Group: Ensure your user is part of the plugdev
group:
sudo usermod -aG plugdev $USER
Reboot: Reboot your system to apply the changes.
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.