ADB on FP2? [Solved: Uncheck all boxes in USB connection popup]

###Solution:


###Original Post:

I’m new to Android (development), so please bear with me and my naive questions. :smile:
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. :slight_smile:

There is one:
https://forum.fairphone.com/c/software/dev

It’s read only until an admin grants you access. I’ll let them know…

Ah, I see. But if it is read only, maybe the intention is different from what I meant. Anyway, the admins will know what to do. :slight_smile:

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…

Klaus

1 Like

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 :slight_smile:

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).

I moved the topic from the FP2 Help category to “Software - FP2 Android 5.1” as this is not a problem, one encounters in everyday use.

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. :slight_smile:

@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. :slight_smile:

1 Like

Okay, can you please post the contents of your udev file here?

sure, I’ll post some additional info in case it helps:

`simon@laptop:~$ cat /etc/udev/rules.d/51-android.rules
#Fairphone
SUBSYSTEM==“usb”, ATTR{idVendor}==“2ae5”, MODE=“0664”, GROUP="plugdev"
simon@laptop:~$ lsusb | grep 2ae5
Bus 001 Device 045: ID 2ae5:f000
simon@laptop:~$ groups
simon adm cdrom sudo dip plugdev lpadmin scanner sambashare libvirtd
simon@laptop:~$ ls -l /dev/bus/usb/001/045
crw-rw-r-- 1 root plugdev 189, 44 Dez 31 00:57 /dev/bus/usb/001/045
simon@laptop:~$ ps aux | grep adb
simon 8650 0.0 0.0 15216 2148 pts/11 S+ 01:12 0:00 grep adb
simon 18634 0.0 0.0 97244 3164 ? Sl 00:33 0:00 adb -P 5037 fork-server server
simon@laptop:~$ kill 18634
simon@laptop:~$ ps aux | grep adb
simon 9080 0.0 0.0 15216 2040 pts/11 S+ 01:12 0:00 grep adb
simon@laptop:~$ adb devices

  • daemon not running. starting it now on port 5037 *
  • daemon started successfully *
    List of devices attached
    simon@laptop:~$ `

Thanks. Well, the udev rule looks fine to me.

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.

Did you try rebooting the phone maybe?

Just did, unfortunately no difference, still an empty device list.

Then I’m running out of ideas - sorry.

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:

simon@laptop:~$ fastboot devices
eccfb6fb	fastboot
simon@laptop:~$ fastboot reboot
rebooting...

finished. total time: 0.001s
simon@laptop:~$

So it seems that fastboot works, but adb still doesn’t work. :confused: Anybody else any idea? :slight_smile:

1 Like

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.

Hello,

to access adb the best is to disable MTP when connected

1 Like