I’m new to Android (development), so please bear with me and my naive questions.
I’m trying to take first steps in adb, running Ubuntu 15.10. So I installed android-tools-adb via the software centre and connected my Fairphone 2 via USB. But it seems that the phone is not recognised by adb while I see it via lsusb (but without any title; see cmd output below), I get no authorisation request on the phone either.
simon@laptop:~$ lsusb | grep 2ae5 Bus 001 Device 034: ID 2ae5:f000 simon@laptop:~$ adb devices List of devices attached simon@laptop:~$
Any hints?
Edit: Could we get a ‘dev’ category in the forum here, or maybe some separated space at code.fairphone.com would be nice?
Edit 2: As I have hit the max. posts on first day for new users limit, I have to update this:
Not sure about that: simon@laptop:~$ sudo adb devices [sudo] Passwort für simon: List of devices attached simon@laptop:~$
Nevertheless I probably need the rule sooner or later, and go ahead to ad it.
Yeah, I guess it’s root only, not for you. There are some hints, and somewhere on the forum another similar tip was already given: (http://wiki.cyanogenmod.org/w/UDEV)
You need some udev.rules, like
SUBSYSTEM==“usb”, ATTR{idVendor}==“fp2code”, MODE=“0664”, OWNER="your account name"
put this line in a file, e.g. /etc/udev/rules.d/51-android.rules
the fp2code you can find with lsusb. In ID xxxx:yyyy xxxx is the code you want. I’m not sure about when udevd gets the change, but the minimum will be remove the usb cable and reconnect. udevd reload or reboot…
No problem. Will go as slow as necessary. Now the sudo probably won’t help, as the first call of adb also starts a server process. I guess you will already have one running with your id: ps -ef |grep adb
If there’s one running with your id, kill it, and repeat the sudo prefixed adb command. That should do the trick
Edit: you might pm me also, but first I need some sleep
Although it isn’t a access rights issue (I believe) I added the udev rule, I’m sure that I would have needed it later.
I also stumbled over the fact that I might need to enable USB debug mode, is that correct? I did it, following two tutorials: 1. Enable developer mode and then 2. Enable USB debugging, in short: tap 7 times on the build number in settings and then there is a new developer mode menu in settings where you can activate the USB debugging.
Unfortunately I still cannot see the fairphone with adb
Another thought that came to my mind: How does adb recognise a phone? Does it use a list of known vendor IDs where Fairphone still might be missing, or something like that? Or does it simply search on all USB devices? No idea how it works, is it maybe possible to define the USB host it should use?
@sjjh: No, afaik adb has no hardcoded list. If you see the phone via lsusb (which is good!) and have adb debugging enabled, then the issue is probably be the missing udev rule as @lklaus already explained.
Please keep in mind, that that most device use different vendor ids for fastboot and adb, so if you want to access it via fastboot as well make sure you also put the second id there (to get it, just run lsusb when in bootloader mode).
As pointed out in my last posting, I actually added that already (with the vendor ID given by lsusb). So I’m a little out of ideas on how to proceed to further debug it.
@Stefan, neither is it a every day use FP2 software issue. If you can move it there (and we can still write then), I believe it probably fits best in the dev category.
I tried to “replay” this with my Nexus S, and this is exactly the behavior I get when I do not enable adb debugging on the device. With adb debugging enabled, you can see the device (as root) even without the udev rule.
One thing you could try is booting into bootloader mode and checking if you can see the device using “fastboot devices” instead of “adb devices”. If you want to run it as user, you will eventually have to put another rule in.
I added the second udev rule with the google vendor id and booted the phone in fastboot mode by pressing “audio down” plus “power”. I could then see the device and continue booting it:
The adb setting should be stored internally in the data partition. See the second answer in this thread:
Unfortunately, if you can’t get adb access in recovery, you will probably not be able to read the settings table in the data partitions without root permissions. You can install a terminal emulator and try on the device, but I doubt this will actually help.
Anyways, if you can’t access the device via adb although you enabled it I would regard this as a bug and contact the support. Or wait and see if somebody else was successful with this.
Thanks for the link. How can I mount the data/ partition in recovery mode?
btw: In recovery mode I can choose to sideload an apk via adb on the phone and then (but only then!) I actually see the phone: simon@laptop:~$ adb devices List of devices attached eccfb6fb sideload
So adb is working in recovery? Very well, this means that your setup on the PC is fine and it’s an issue with Fairphone OS not respecting the developer mode / adb settings.
Actually, if you can log into the device via
adb shell
You should be able to do pretty much everything (not as root though) from there. Anyways…I would just do a factory reset and if adb is still broken afterwards then contact the support.