1

I am using a nexus 5 (hammerhead), and I just built AOSP marshmallow from source. I was trying various build configurations (user-debug vs user etc), and along the way, I did something which causes both my mac (yosemite) and my ubuntu vm (14.04), to not be authorised to debug via adb. ie. if I type "adb devices", then I see a message:

0c4a84901a7ce6a2    unauthorized

Facts -

  1. Although I built the source code, and flashed the device on the ubuntu vm, yosemite is not authorised either - same message (can't understand why).

  2. Fastboot has the same problem, if I try rebooting into the boot loader by issuing a command from the terminal. If I use the hardware buttons to launch the boot loader menu, then I can flash files, lock / unlock the boot loader etc.

  3. I have tried killing / restarting the adb server (e.g.: adb kill-server / adb start-server)

  4. I have tried deleting ~./.android/adbkey.pub in my ubuntu vm. Since it made no difference, I did not delete it in my mac.

  5. I have tried restarting my mac, ubuntu vm, adb in combination...

  6. When I enable / disable USB debugging on the device, no message pops up asking me to verify the computers finger print, and there is no option in the setting to revoke all the fingerprints (which is present in regular stock android roms / factory images)

I'm not sure what to do now. I know I can flash the factory image of marshmallow, so everything on the phone should be pristine. But What I want to know is why adb is unauthorised right now, and how to fix it - so I can get back to making aosp roms.

EDIT: I just flashed the marshmallow factory image, and now adb is authorised on my mac, but in ubuntu, I'm still listed as unauthorized, even after killing / restarting the server.

EDIT: I built and flashed AOSP 6.0 with build configuration set as user-debug, and it seems dab is authorised again. So I imagine this is because when the build configuration is "user", adb is prevented from debugging. I wonder why, and how to fix this?

Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
  • can you check [this](http://askubuntu.com/questions/213874/how-to-configure-adb-access-for-android-devices) for ADB unauthorised to debug issue – pRaNaY Nov 10 '15 at 04:09
  • @pRaNaY - I don't think that is the problem, because it was working earlier. I don't think I should have to configure USB access, because then I probably wouldn't have been able to flash the rom in the first place.. – Rahul Iyer Nov 10 '15 at 04:16
  • same problem i faced in my Ubuntu and got solved by adding vendor device in `android.rules` files. please refer [this](http://stackoverflow.com/questions/23493710/ubuntu-is-not-detecting-my-android-device) to get more idea. – pRaNaY Nov 10 '15 at 04:49
  • Android developer link for [USB Vendor IDs](http://developer.android.com/tools/device.html#VendorIds) – pRaNaY Nov 10 '15 at 04:56
  • @pRaNaY I think my problem is different, because in my case it does not display ?????????? - it actually shows the hash, and says "unauthorised" next to it, not "no permissions". Also the problem goes away if I use "user-debug" build configuration, so it must have something to do with the build configuration. – Rahul Iyer Nov 10 '15 at 05:44
  • check [this](http://code.google.com/p/android/issues/detail?id=152172&q=subcomponent%3DTools-adb%20attachments%3D0&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars) Google group discussion. – pRaNaY Nov 10 '15 at 06:17
  • @John did you ever solve this problem? It must have something to do with the user build. on user-debug and eng builds everything works fine. what am i missing? btw, same problem both on linux and windows – Vlad Apr 21 '16 at 11:05
  • @Vlad - no I didn't solve it - but i believe the answer has to do with some configuration files. For example, you can specify whether debugging is allowed in production builds, and likewise you can modify security settings to check the key etc (which doesn't happen in the default debug build of aosp). If you google you might find a thread about this somewhere, or just dig through the various configs yourself. Its probably really simple to fix, I just didn't have the time to research it anymore. Ask Vimalesh - he probably knows. – Rahul Iyer Apr 21 '16 at 12:54
  • @John I've googled like crazy already and tried to dig in the .prop files.. but no configuration i come up with actually works :\ – Vlad Apr 21 '16 at 13:15
  • @Vlad Just ask Vimalesh (the answer below) – Rahul Iyer Apr 22 '16 at 04:47
  • @John ok Vimalesh was right :) – Vlad Apr 24 '16 at 09:18

2 Answers2

4

In case of AOSP user build, you may wish to check if ro.adb.secure=1, in your build default.prop. If not defined, then the popup to verify computer fingerprint may not come up.

  • This is the right answer. I was stuck for a week because i confused ro.adb.secure = 1 for ro.secure = 1 :( – Vlad Apr 24 '16 at 09:19
  • @Vimalesh Kamat or Vlad - can you provide a detailed answer or explanation ? – Rahul Iyer May 14 '16 at 04:44
  • This worked for me. Make sure to add ro.adb.scure=1 for user builds. You can include it with your device makefile with PRODUCT_PROPERTY_OVERRIDES += ro.adb.secure=1 – pdsouza Oct 13 '16 at 02:12
1

I find that my android devices are "unauthorized" if usb-debugging is not enabled, or my computer's fingerprint was never accepted as authorized. Also, USB connection mode needs to be set to File transfer or photo transfer (MTP or PTP) for some versions of Android.

Try the following:

  1. Connect usb cable to computer.
  2. Go to Developer-options
  3. Revoke USB Debugging authorizations
  4. Disable and then enable USB Debugging
  5. Accept "Allow USB Debugging" message

After this sequence, I always get message to accept computer's fingerprint on Ubuntu.

GPS
  • 1,322
  • 1
  • 18
  • 40