Android Studio - ADB 错误 - “...设备未经授权。请检查您设备上的确认对话框。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26079838/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android Studio - ADB Error - "...device unauthorized. Please check the confirmation dialog on your device."
提问by Georgi Angelov
So I started getting errors in my ADB logs which, I think, are causing my device to now display any logcat output for my app. I am getting all the logcat output except the one from the app itself.
所以我开始在我的 ADB 日志中收到错误,我认为这导致我的设备现在显示我的应用程序的任何 logcat 输出。我正在获取除应用程序本身之外的所有 logcat 输出。
PropertyFetcher: AdbCommandRejectedException getting properties for device 04799057970ed1fc: device offline
PropertyFetcher: AdbCommandRejectedException getting properties for device 03799467970ed5fg: device unauthorized. Please check the confirmation dialog on your device.
回答by Eefret
you have missed the Fingerprint Certificate Authorization dialog in your phone when you connected it, try to change the USB mode to Media, or another different than the one you have in and then reconnect your device, or go to Developer Options -> Revoke USB Debugging and reconnect, watch for the dialog and click on accept, that should solve your problems.
您在连接手机时错过了手机中的指纹证书授权对话框,尝试将 USB 模式更改为媒体模式,或另一种与您现有的模式不同的模式,然后重新连接您的设备,或转到开发人员选项 -> 撤销 USB 调试并重新连接,注意对话框并单击接受,这应该可以解决您的问题。
If that doesn't work, set your ANDROID_SDK_HOME again, and then:
如果这不起作用,请再次设置您的 ANDROID_SDK_HOME,然后:
- Unplug device
Run:
adb kill-server adb start-server
Plug in device
- 拔下设备
跑:
adb kill-server adb start-server
插入设备
回答by xdjkx
I experienced the same issue.
我遇到了同样的问题。
To ensure that your Android Device is expecting the correct fingerprint from the system (e.g. after switching Android SDK installations -> different adb server running!), do the following (actually, this did the magic for me):
为确保您的 Android 设备期望来自系统的正确指纹(例如,在切换 Android SDK 安装之后 -> 运行不同的 adb 服务器!),请执行以下操作(实际上,这对我来说很神奇):
- unplug your Android Device
- revoke USB debugging authorizations in Android Developer Options
- plug your Device. You can accept the fingerprint once more.
- 拔掉你的安卓设备
- 在 Android 开发者选项中撤销 USB 调试授权
- 插入您的设备。您可以再次接受指纹。
回答by junkle
Please check this. https://code.google.com/p/android/issues/detail?id=82850
请检查这个。 https://code.google.com/p/android/issues/detail?id=82850
I faced the same issue. Could notice that the "adb integration" was disabled. Please enable it at your IDE (Tools | Android)
我遇到了同样的问题。可以注意到“adb 集成”已被禁用。请在您的 IDE 中启用它(工具 | Android)
回答by Deepak Kumar
1) Go to Phone Setting > Developer options > Revoke USB debugging.
1)进入手机设置>开发者选项>撤销USB调试。
2) Turn off USB debugging and Restart Again.
2)关闭USB调试并重新启动。
It will work definitely, in my case it worked.
它肯定会起作用,就我而言,它起作用了。
回答by O Ndiaye
This happened to me because I enabled usb debug previously on another pc. So to mke it work on a second pc I had to disable usb debugging and re-enable it while connected to the second pc and it worked.
这发生在我身上,因为我之前在另一台电脑上启用了 USB 调试。所以为了让它在第二台电脑上工作,我必须禁用 USB 调试并在连接到第二台电脑时重新启用它并且它工作。
回答by user3255406
The solution to this was just to change the USB cable, having enabled ADB Integrationvia
解决这个问题的方法只是更换 USB 电缆,通过以下方式启用 ADB 集成
Tools > Android > Enable ADB Integration.
工具 > Android > 启用 ADB 集成。
回答by Rahul Baradia
Below are the commands for Ubuntu user to authorise devices once developer option is ON.
以下是 Ubuntu 用户在开发人员选项打开后授权设备的命令。
sudo ~/Android/Sdk/platform-tools/adb kill-server
sudo ~/Android/Sdk/platform-tools/adb kill-server
sudo ~/Android/Sdk/platform-tools/adb start-server
sudo ~/Android/Sdk/platform-tools/adb start-server
On Device:
在设备上:
- Developer option activated
- USB debugging checked
- 开发者选项已激活
- USB调试检查
Connect your device now and you must only accept request, on your phone.
现在连接您的设备,您只能在手机上接受请求。
回答by OmarACY
Remove the Debug permissions on the Device, with the cell phone connected, then put them back, and ask if you want to allow the PC to have debug, accept and ready permissions: D
把Device上的Debug权限去掉,手机连上,然后放回去,问是否要让PC有debug、accept和ready权限:D
回答by D0SBoots
In my case, it was literally a bad USB cable. Apparently it was right on the edge - adb logcat would work, but about half the time I would get this error when trying to push an app to the device.
就我而言,它实际上是一根坏的 USB 电缆。显然这是正确的 - adb logcat 可以工作,但大约有一半的时间我会在尝试将应用程序推送到设备时遇到此错误。
Changed to a different cable, and everything was fine. The old cable was also very slow at charging, so I should have suspected it sooner...
换了一条不同的电缆,一切都很好。旧电缆充电也很慢,所以我应该早点怀疑它......
回答by tommybee
I've got the same message too. In my case, I have changed my dev environment to another notebook pc and my device is samsung galaxy note 2014 edition. My OS is windows 7
我也收到了同样的信息。就我而言,我已将我的开发环境更改为另一台笔记本电脑,我的设备是 samsung Galaxy Note 2014 版。我的操作系统是 Windows 7
My galaxy note condition listed as following
我的银河笔记状况如下
- developer option activated
- USB debugging checked
- 开发者选项已激活
- USB调试检查
The error message was "device unauthorized. Please check the..."
错误消息是“设备未经授权。请检查...”
In general, the location of the default android setting was C:/Users/Your_login_name/.android
then I copied and pasted all files in the '.android' folder to my new pc's setting folder.
通常,默认 android 设置的位置是C:/Users/Your_login_name/.android
然后我将“.android”文件夹中的所有文件复制并粘贴到我的新电脑的设置文件夹中。
After that the problem was gone.
之后问题就没有了。
I think the problem was adbkey
file mismatched.
Also, I didn't have any menu name such as revoke adb authorization
.
我认为问题是adbkey
文件不匹配。另外,我没有任何菜单名称,例如revoke adb authorization
.