Configuration:
- Windows 8.1
- ADB version: 1.0.32
- Smartphone: Oneplus One
Problem
I installed the Samsung drivers as it is said to do. When I run the ADB devices command, it said unauthorized.
Already tried:
I've done everything that'd been said on this post: https://stackoverflow.com/a/25546300/1848376
But the problem is that I don't get a prompt on the phone to tell me I must accept the connection.
When I run the command
adb shell
, here is the answer:error: device unauthorized. This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong. Otherwise check for a confirmation dialog on your device.
I did "adb kill-server", but it didn't change anything. Why?
I got this as root when as a non-root user I was getting permissions errors trying to connect to custom recovery (Philz). so I killed adb server, copied the .android subdirectory of my user account into /root, chowned -R to root.root, and restarted adb server. I'm in!
I suppose you have enabled On-device Developer Options in your smartphone? If not you can take a look at the steps provided by Android, http://developer.android.com/tools/device.html#developer-device-options
In Android studio,
Run menu > Run
showsOFFLINE ...
for the connected device.Below is the procedure followed to solve it:
(Read the below note first) Delete the
~/.android/adbkey
(or, rename to~/.android/adbkey2
, this is even better incase you want it back for some reason)Note: I happened to do this step, but it didn't solve the problem, after doing all the below steps it worked, so unsure if this step is required.
Run
locate platform-tools/adb
Note: use the path that comes from here in below commands
Kill adb server:
sudo ~/Android/Sdk/platform-tools/adb kill-server
You will get a
Allow accept..
message popup on your device. Accept it. This is important, which solves the problem.Start adb server:
sudo ~/Android/Sdk/platform-tools/adb start-server
In Android studio, do
Run menu > Run
againIt will show something like
Samsung ...
(your phone manufacture name).Also installs the apk on device correctly this time without error.
Hope that helps.
Delete existing adbkeys
OR
Rename adbkeys
Best practise is to rename the keys because it provides backup.
cd ~/.Android
mv adbkey adbkey2
mv adbkey.pub adbkey.pub2
Next stop & start the server
cd ~/Android/Sdk/platform-tools
Locate the device
/Android/Sdk/platform-tools$ ./adb devices
/Android/Sdk/platform-tools$ ./adb kill-server
/Android/Sdk/platform-tools$ ./adb start-server
Then, stop the emulator Open AVD manager, click on the down arrow, then click on wipe data
Restart the emulator. Then everything works fine :)
for anyone encountering this later this may also help. I encountered this exact issue trying to use adb from a user command prompt and the answers above did not help, but the problem went away with an "adb kill-server" when running in an administrator command prompt.
In sequence:
in your DEVICE SETUP, go to developer-options end disable usb-debugging
press REVOKE USB debugging authorizations, click OK
enable usb-debugging