I am not sure if you ever solved this problem, but I ran into this problem, and tried out many many different procedures, each of which might have helped others, but this is 2016 and a summary might help.
A brand new phone bought in 2016 didn't work when I installed Android Studio on Linux. A phone bought in 2015 worked without a problem. A new phone didn't work with the exact same configuration.
When I have Android Studio open, the AVD manager didn't show the new phone, but showed the old one. The old phone, when connected on the USB plug, threw a dialog asking me to confirm the fingerprint of the RSA key, but the new phone didn't show the same dialog when connected.
I found a tip at
https://stackoverflow.com/questions/18011685/cant-connect-nexus-4-to-adb-unauthorized
and tried it out and it worked for me.
I removed two files adbkey and adbkey.pub from ~/.android. Apparently android-studio detects this and creates the keys immediately. As soon as this occurs, the new phone threw the dialog open and started working. I am able to see the phone on the Android-Studio's AVD menu and start running the applications.
adb version 1.0.31, BUT, if I try to run 'adb devices' on the command line, Android-Studio stops showing this phone on the AVD menu.
I still don't see the phone (but that does not bother me as I am able to see the phone from the AVD menu). adb command line utility only showed an emulator that was running, but not the phone connected in debugging mode, one that was seen on the AVD menu, up until the command was run.
$ adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
emulator-5554 device
At this point, reconnecting the phone does not help. AVD menu only showed the emulator that was still running on my computer.
You have to run 'adb kill-server'. Once that is done, and if you open up the AVD menu, Android Studio initializes its own ADB and the phone shows up on the AVD menu.
adb version 1.0.31
Android Studio 2.1
So in summary: two things.
- Delete adbkey and adbkey.pub from ~/.android while Android Studio is open.
- Do not run command line utility adb. It messes with the server instance run by Android Studio. The server instance from commandline works for some phones but not all. Android-Studio works with all the phones I have.
All the above is of course after making sure:
- you tap the 'build number' thing 7 times and enabling the USB debugging mode...
- tried 'revoking the debug permissions' many times
- tried rebooting the phone a few times
- enable/disable/enable usb debugging mode,
All the above steps seemed like voodoo things to try, but essentially they didn't work, except the ones I listed above.
(Update: Adding this line that was originally a comment, but belongs in the answer).
I also had to add the new phone's vendor ID to /etc/udev/rules.d/51-android.rules file to help identify the new phone and to set the permissions.