-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENV{adb_user} or ENV{adb_adb} or other? #215
Comments
Hello, M0Rf30. In general, I have not yet found anything better than to select an environment variable from the list:
I don't know how much this is correct for various situations, but I'll leave it like this for now. Still, I would like to stick something universal in ENV{}. I wish you and the team a successful development of your project Sincerely, |
Hi @AKotov-dev and thanks for your considerations. |
OK, thanks. :) |
Hi @AKotov-dev, Basically 51-android rules is a text file. This text file follows very basic commands. If we read your example above, what it means is: # Nokia-3310 my super phone
ATTR{idVendor}=="13fe", ATTR{idProduct}=="6300", ENV{adb_user}="yes"
Originally, back in 2011, the rules were simple, we only needed to say yes, we found it. What happened then is other developers started adding more features to 51-android-rules SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1" To help reduce the confusion, an attempt some cleanup was made, some of it as best guess since we don't have all these phones to test with, and other developers have moved on and are no longer watching. To answer your question, you need to look at the bottom of 51-android rules. Some users want FAST too, so, "adb_fast" will do the same as "adb_adb" and also set "SYMLINK+=android_fast" There is room for future expansion, since you can see some users added some very interesting additions, and some users wanted to help but did not really understand what was needed so they copied other code, so it may have errors. If you see errors, it is worth correcting it, since the more eyes that look at the code, the better chance of fixing errors. If some of the idVendor are confusing, just remember companies are bought and sold, and so they may have more than one idVendor. Also they may hire other companies to help. Looking at your example, it looks like Nokia has idVendor of 13fe, or 0421, or 2e04 which seems confusing. |
Hello @JoesCat, No, no, no... The I think it will not be possible to take into account all the features of the devices in the editor, so I am only interested in adb/fastboot for now. An ordinary user is unlikely to enter the rules manually to use the additional features of the device. Does your explanation mean that in the new 51-android.rules format from @M0Rf30, I need to focus exclusively on variables like However...
May be p.s. I apologize for the large number of questions. I'm just trying to choose one of the many options... :) |
Not just smart phones. For you to keep it simple, start with the basics. The "adb_user" was added later, and it adds a nice feature for users with more than one android device - this will come in handy for midi_user since midi can sometimes be more than one device. If you have more than one android device added you will see "dev/android[1,2,3,4,5....] for multiple devices and the last device plugged in as "/dev/android": ls -l /dev/android*
lrwxrwxrwx 1 root root 15 Sep 12 11:04 /dev/android -> bus/usb/001/004
lrwxrwxrwx 1 root root 15 Sep 12 11:04 /dev/android7 -> bus/usb/001/004
lrwxrwxrwx 1 root root 15 Sep 12 10:34 /dev/android8 -> bus/usb/001/002 This is the important thing to know with using "adb_adb" and "adb_adbfast"... ls -l /dev/android*
lrwxrwxrwx 1 root root 15 Sep 12 11:04 /dev/android_adb -> bus/usb/001/004 The "android_adb" is the important SYMLINK. Another thing to keep in mind is you are sharing USB with another project that has many, many, more users (there are many more ordinary users than there are developers), that simply want to plug in their phone and fetch/save information to the phone - you will see those other rules in the same directory. I think it is this project: https://sourceforge.net/projects/libmtp/ so you need to try and keep your rules compatible with their project too. |
When DEBUG/DEVELOPER mode is "OFF", your android device should work with https://sourceforge.net/projects/libmtp/ and if not, it is a good idea to share information with them too so their project works better too. We all want our devices to work with libmtp too. |
Hi, @JoesCat. In general, I left in my editor for the user to choose from the list:
I think that's enough for him to start with. As the functionality of About MTP... I am not familiar with this connection protocol in detail, but I have previously read several articles and reviews about it on various forums. The reviews are not too good, for example here (Russian): https://www.linux.org.ru/forum/desktop/13867008
MTP pulls too many dependencies: I don't want to say that this technology is somehow worse or better than others, but I just decided not to get involved. :) To transfer files, I made myself an With respect, |
I reported these details here Many thanks. I'm closing this. Happy New Year's Eve |
Hello, M0Rf30 (Gianluca Boiano). Thank you and the team for your useful and necessary work. Rules
51-android.rules
work well, including with new smartphones.I apologize in advance for my poor English, I write through an online translator. :)
I don't have a message about adding rules or an error, I only need your advice if you don't mind. For myself and other users inexperienced in
udev
, I studied the drawing (style) of the code in which you write rules and made an automatic rule editor for your51-android.rules
: https://github.com/AKotov-dev/areditorThis can be useful for emergency insertion of the necessary rule, if it is missing, since packages with distribution updates are not released as often as we would like.
It searches for and shows in the list of rules a device that is connected to USB. If the device is not found, it offers to insert a ready-made rule with a comment like:
The editor analyzes 3 main fragments of the rules:
ATTR{idVendor}==idVendor, ENV{adb_user}="yes"
ATTR{idVendor}==idVendor, ATTR{idProduct}==idProduct, ...
ATTR{idVendor}!=idVendor ...
ATTR{idProduct}==idProduct ...
I noticed that outside the
GOTO/LABEL
blocks you useENV{adb_user}= "yes"
, and inside theGOTO/LABEL
blocks -ENV{adb_adb}="yes"
and some other combinations (ENV{adb_adbfast}="yes", SYMLINK+="android_adb").Question: which
ENV{adb_user}="yes"
orENV{adb_adb}="yes"
(or something elseENV{???}
) is it better to use it for automatic addition to the list of rules so that the smartphone/device is guaranteed to work/recognized?For example:
ATTR{idVendor}=="13fe", ATTR{idProduct}=="6300", ENV{?right here?}="yes"
Thank you in advance.
Sincerely,
Alex
The text was updated successfully, but these errors were encountered: