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
1 Answer
Reset to default 0The 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 runninglsusb
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.
本文标签:
版权声明:本文标题:android - Is there any way of making ADB not crash when file transfer is not enabled on phone connected through USB? - Stack Ove 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741922622a2405096.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论